Inline small functions
This commit is contained in:
17
index.js
17
index.js
@@ -56,13 +56,22 @@ Pjax.switches = switches
|
|||||||
Pjax.prototype = {
|
Pjax.prototype = {
|
||||||
log: require("./lib/proto/log.js"),
|
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"),
|
attachLink: require("./lib/proto/attach-link.js"),
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +0,0 @@
|
|||||||
module.exports = function(el) {
|
|
||||||
return el.querySelectorAll(this.options.elements)
|
|
||||||
}
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
var forEachEls = require("../foreach-els")
|
|
||||||
|
|
||||||
var parseElement = require("./parse-element")
|
|
||||||
|
|
||||||
module.exports = function(el) {
|
|
||||||
forEachEls(this.getElements(el), parseElement, this)
|
|
||||||
}
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
module.exports = function(el) {
|
|
||||||
this.parseDOM(el || document)
|
|
||||||
}
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
module.exports = function() {
|
|
||||||
window.location.reload()
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user