Fix bug when checking if elements were parsed already

parse-element.js checks if the element was already parsed by
checking for the `data-pjax-click-state` attribute. However, this
attribute was not added until the link is clicked.

Originally, there was a separate attribute, `data-pjax-enabled`,
which tracked if the element was parsed already, but that was
changed in 9a86044.

This commit merges the attributes for mouse clicks and key presses
into one and adds that attribute when the element is initially
parsed.
This commit is contained in:
Behind The Math
2018-03-19 22:08:56 -04:00
parent 688810fbae
commit ee82d0e0c7
3 changed files with 12 additions and 18 deletions

View File

@@ -5,7 +5,7 @@ var trigger = require("../../../lib/events/trigger")
var attachLink = require("../../../lib/proto/attach-link")
var a = document.createElement("a")
var attr = "data-pjax-click-state"
var attr = "data-pjax-state"
var preventDefault = function(e) { e.preventDefault() }
tape("test attach link prototype method", function(t) {