From 3d25bee131dc12b8a9c7373ed6678d2f2cc0fd42 Mon Sep 17 00:00:00 2001 From: darylteo Date: Tue, 5 Jan 2016 14:22:03 +1100 Subject: [PATCH] Bind required functions to pjax --- index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index e17eef1..f41a3c5 100644 --- a/index.js +++ b/index.js @@ -49,11 +49,11 @@ Pjax.prototype = { attachLink: require("./lib/proto/attach-link.js"), forEachSelectors: function(cb, context, DOMcontext) { - return require("./lib/foreach-selectors.js")(this.options.selectors, cb, context, DOMcontext) + return require("./lib/foreach-selectors.js").bind(this)(this.options.selectors, cb, context, DOMcontext) }, switchSelectors: function(selectors, fromEl, toEl, options) { - return require("./lib/switches-selectors.js")(this.options.switches, this.options.switchesOptions, selectors, fromEl, toEl, options) + return require("./lib/switches-selectors.js").bind(this)(this.options.switches, this.options.switchesOptions, selectors, fromEl, toEl, options) }, // too much problem with the code below