From a11903387059fe10ffe78d32d00221a46d778634 Mon Sep 17 00:00:00 2001 From: Isaac Gierard Date: Fri, 16 Jan 2015 15:44:57 -0800 Subject: [PATCH] fixed some require paths also added isSupported include to index.js --- index.js | 5 ++++- lib/proto/parse-dom.js | 2 +- lib/switches.js | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/index.js b/index.js index bc68870..db41466 100644 --- a/index.js +++ b/index.js @@ -51,7 +51,7 @@ Pjax.prototype = { }, switchSelectors: function(selectors, fromEl, toEl, options) { - return require("./lib/switch-selectors.js")(this.options.switches, this.options.switchesOptions, selectors, fromEl, toEl, options) + return require("./lib/switches-selectors.js")(this.options.switches, this.options.switchesOptions, selectors, fromEl, toEl, options) }, // too much problem with the code below @@ -209,6 +209,9 @@ Pjax.prototype = { } } +Pjax.isSupported = require("./lib/is-supported.js"); + +//arguably could do `if( require("./lib/is-supported.js")()) {` but that might be a little to simple if (Pjax.isSupported()) { module.exports = Pjax } diff --git a/lib/proto/parse-dom.js b/lib/proto/parse-dom.js index e9dfb64..626dc2f 100644 --- a/lib/proto/parse-dom.js +++ b/lib/proto/parse-dom.js @@ -1,6 +1,6 @@ var forEachEls = require("../foreach-els") -var parseElement = require("../parse-element") +var parseElement = require("./parse-element") module.exports = function(el) { forEachEls(this.getElements(el), parseElement, this) diff --git a/lib/switches.js b/lib/switches.js index 56a91b6..9f5fcec 100644 --- a/lib/switches.js +++ b/lib/switches.js @@ -1,4 +1,4 @@ -var on = require("./lib/events/on.js") +var on = require("./events/on.js") // var off = require("./lib/events/on.js") // var trigger = require("./lib/events/trigger.js")