Update refresh and handle attributes without values #67

Merged
compressed merged 2 commits from refresh into master 2016-06-28 00:17:43 -05:00
2 changed files with 7 additions and 5 deletions

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("=")
if (attr.length === 1) {
tmpEl.documentElement.setAttribute(attr[0], true)
}
else {
tmpEl.documentElement.setAttribute(attr[0], attr[1].slice(1, -1)) tmpEl.documentElement.setAttribute(attr[0], attr[1].slice(1, -1))
}
}) })
} }
} }

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)
} }