Gitako/packages/pjax/lib/proto/parse-element.js
EnixCoda 7e6feb621c
revert: use old pjax for Firefox compatibility
This reverts commit 8aaf55be59 and 0a4ee27
2020-04-06 19:16:36 +08:00

18 lines
389 B
JavaScript

var attrState = "data-pjax-state"
module.exports = function(el) {
switch (el.tagName.toLowerCase()) {
case "a":
// only attach link if el does not already have link attached
if (!el.hasAttribute(attrState)) {
this.attachLink(el)
}
break
case "form":
break
default:
throw "Pjax can only be applied on <a> or <form> submit"
}
}