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

Merged
BehindTheMath merged 1 commits from enhancement/pass-element-triggered into master 2017-12-21 13:06:50 -05:00
2 changed files with 7 additions and 2 deletions

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);
}; };

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) {