Code cleanup #120

Merged
BehindTheMath merged 13 commits from cleanup/misc-cleanup into master 2018-02-02 09:52:45 -05:00
5 changed files with 13 additions and 20 deletions
Showing only changes of commit 2ec4c14a46 - Show all commits

View File

@@ -56,13 +56,22 @@ Pjax.switches = switches
Pjax.prototype = {
log: require("./lib/proto/log.js"),
getElements: require("./lib/proto/get-elements.js"),
getElements: function(el) {
return el.querySelectorAll(this.options.elements)
},
parseDOM: require("./lib/proto/parse-dom.js"),
parseDOM: function(el) {
var parseElement = require("./parse-element")
forEachEls(this.getElements(el), parseElement, this)
},
refresh: require("./lib/proto/refresh.js"),
refresh: function(el) {
this.parseDOM(el || document)
},
reload: require("./lib/reload.js"),
reload: function() {
window.location.reload()
},
attachLink: require("./lib/proto/attach-link.js"),

View File

@@ -1,3 +0,0 @@
module.exports = function(el) {
return el.querySelectorAll(this.options.elements)
}

View File

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

View File

@@ -1,3 +0,0 @@
module.exports = function(el) {
this.parseDOM(el || document)
}

View File

@@ -1,3 +0,0 @@
module.exports = function() {
window.location.reload()
}