Pass the element that triggered Pjax to the pjax:send event

Closes #62.
This commit was merged in pull request #94.
This commit is contained in:
Behind The Math authored and BehindTheMath committed 2017-12-21 13:06:49 -05:00
1 parent 0916c74171
commit d3d5ef7a11
2 files changed
+7 -2

No files matched your search

+3 -1
View File
@@ -60,7 +60,9 @@ var formAction = function(el, event){
el.setAttribute(attrClick, "submit"); el.setAttribute(attrClick, "submit");
this.loadUrl(virtLinkElement.href, clone(this.options)) const options = clone(this.options);
options.triggerElement = el;
this.loadUrl(virtLinkElement.href, options);
}; };
+4 -1
View File
@@ -53,7 +53,10 @@ var linkAction = function(el, event) {
} }
this.options.requestOptions = this.options.requestOptions || {}; this.options.requestOptions = this.options.requestOptions || {};
el.setAttribute(attrClick, "load") el.setAttribute(attrClick, "load")
this.loadUrl(el.href, clone(this.options))
const options = clone(this.options)
options.triggerElement = el
this.loadUrl(el.href, options)
} }
var isDefaultPrevented = function(event) { var isDefaultPrevented = function(event) {