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
2017-12-21 00:12:09 -05:00
committed by BehindTheMath
parent 0916c74171
commit d3d5ef7a11
2 changed files with 7 additions and 2 deletions

View File

@@ -60,7 +60,9 @@ var formAction = function(el, event){
el.setAttribute(attrClick, "submit");
this.loadUrl(virtLinkElement.href, clone(this.options))
const options = clone(this.options);
options.triggerElement = el;
this.loadUrl(virtLinkElement.href, options);
};

View File

@@ -53,7 +53,10 @@ var linkAction = function(el, event) {
}
this.options.requestOptions = this.options.requestOptions || {};
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) {