Merge pull request #67 from compressed/refresh

Update refresh and handle attributes without values
This commit was merged in pull request #67.
This commit is contained in:
Maxime Thirouin authored and GitHub committed 2016-06-28 07:17:43 +02:00
commit eff7cfd452
2 files changed
+7 -5

No files matched your search

+6 -1
View File
@@ -94,7 +94,12 @@ Pjax.prototype = {
matches.shift() matches.shift()
matches.forEach(function(htmlAttrib) { matches.forEach(function(htmlAttrib) {
var attr = htmlAttrib.trim().split("=") var attr = htmlAttrib.trim().split("=")
tmpEl.documentElement.setAttribute(attr[0], attr[1].slice(1, -1)) if (attr.length === 1) {
tmpEl.documentElement.setAttribute(attr[0], true)
}
else {
tmpEl.documentElement.setAttribute(attr[0], attr[1].slice(1, -1))
}
}) })
} }
} }
+1 -4
View File
@@ -1,6 +1,3 @@
var parseDom = require("./parse-dom")
module.exports = function(el) { module.exports = function(el) {
parseDom(el || document) this.parseDOM(el || document)
} }