From 477d9678042631e56f3577a20148c389d12e0cfc Mon Sep 17 00:00:00 2001 From: darylteo Date: Tue, 5 Jan 2016 15:02:39 +1100 Subject: [PATCH] Add clone and executeScripts as well --- index.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index ffef856..460d045 100644 --- a/index.js +++ b/index.js @@ -1,3 +1,6 @@ +var clone = require('./lib/clone.js') +var executeScripts = require('./lib/execute-scripts.js') + var forEachEls = require("./lib/foreach-els.js") var newUid = require("./lib/uniqueid.js") @@ -20,7 +23,7 @@ var Pjax = function(options) { on(window, "popstate", function(st) { if (st.state) { - var opt = Pjax.clone(this.options) + var opt = clone(this.options) opt.url = st.state.url opt.title = st.state.title opt.history = false @@ -121,7 +124,7 @@ Pjax.prototype = { // execute scripts when DOM have been completely updated this.options.selectors.forEach(function(selector) { forEachEls(document.querySelectorAll(selector), function(el) { - Pjax.executeScripts(el) + executeScripts(el) }) }) // }