From cc1c57cc3d620bfe31b4250672019a47b9362f4d Mon Sep 17 00:00:00 2001 From: Behind The Math Date: Tue, 19 Dec 2017 00:34:38 -0500 Subject: [PATCH] Add default switches to Pjax.switches Fixes #68 and reverts #74 --- README.md | 2 +- index.js | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 2e6cf08..6b706c9 100644 --- a/README.md +++ b/README.md @@ -248,7 +248,7 @@ with or without [WOW.js](https://github.com/matthieua/WOW). new Pjax({ selectors: ["title", ".js-Pjax"], switches: { - ".js-Pjax": require("pjax/lib/switches.js").sideBySide + ".js-Pjax": Pjax.switches.sideBySide }, switchesOptions: { ".js-Pjax": { diff --git a/index.js b/index.js index e628021..b7f7b3b 100644 --- a/index.js +++ b/index.js @@ -9,6 +9,8 @@ var on = require("./lib/events/on.js") // var off = require("./lib/events/on.js") var trigger = require("./lib/events/trigger.js") +var defaultSwitches = require("./lib/switches") + var Pjax = function(options) { this.firstrun = true @@ -42,6 +44,8 @@ var Pjax = function(options) { }.bind(this)) } +Pjax.switches = defaultSwitches + Pjax.prototype = { log: require("./lib/proto/log.js"),