fixed some require paths also added isSupported include to index.js

This commit is contained in:
Isaac Gierard
2015-01-16 15:44:57 -08:00
parent 482ba2c117
commit a119033870
3 changed files with 6 additions and 3 deletions

View File

@@ -51,7 +51,7 @@ Pjax.prototype = {
}, },
switchSelectors: function(selectors, fromEl, toEl, options) { 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 // 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()) { if (Pjax.isSupported()) {
module.exports = Pjax module.exports = Pjax
} }

View File

@@ -1,6 +1,6 @@
var forEachEls = require("../foreach-els") var forEachEls = require("../foreach-els")
var parseElement = require("../parse-element") var parseElement = require("./parse-element")
module.exports = function(el) { module.exports = function(el) {
forEachEls(this.getElements(el), parseElement, this) forEachEls(this.getElements(el), parseElement, this)

View File

@@ -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 off = require("./lib/events/on.js")
// var trigger = require("./lib/events/trigger.js") // var trigger = require("./lib/events/trigger.js")