fix(attributes): for attributes without a value, add only the attribute
Some attributes, such as `itemscope` have no corresponding value. This change allows them to still be set.
This commit is contained in:
5
index.js
5
index.js
@@ -94,7 +94,12 @@ Pjax.prototype = {
|
||||
matches.shift()
|
||||
matches.forEach(function(htmlAttrib) {
|
||||
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))
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user