From beaa21fb3ad0070c42510f400127334cef94d71a Mon Sep 17 00:00:00 2001 From: Christopher Brickley Date: Tue, 19 Apr 2016 12:13:14 -0400 Subject: [PATCH 1/2] fix(refresh): use `this.parseDOM` for refresh Fix for issue mentioned in #36 --- lib/proto/refresh.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/lib/proto/refresh.js b/lib/proto/refresh.js index 504aa44..ba8bfa5 100644 --- a/lib/proto/refresh.js +++ b/lib/proto/refresh.js @@ -1,6 +1,3 @@ - -var parseDom = require("./parse-dom") - module.exports = function(el) { - parseDom(el || document) + this.parseDOM(el || document) } From bf7189439504ce9fc9ea6b3770c1166a75254904 Mon Sep 17 00:00:00 2001 From: Christopher Brickley Date: Tue, 19 Apr 2016 12:15:39 -0400 Subject: [PATCH 2/2] 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. --- index.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index a548998..efa2517 100644 --- a/index.js +++ b/index.js @@ -94,7 +94,12 @@ Pjax.prototype = { matches.shift() matches.forEach(function(htmlAttrib) { 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)) + } }) } }