Code cleanup

This commit is contained in:
Behind The Math
2018-04-09 17:39:20 -04:00
parent 4c0b6d6251
commit a42ae57448
2 changed files with 5 additions and 3 deletions

View File

@@ -1,15 +1,17 @@
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("data-pjax-state")) {
if (!el.hasAttribute(attrState)) {
this.attachLink(el)
}
break
case "form":
// only attach link if el does not already have link attached
if (!el.hasAttribute("data-pjax-state")) {
if (!el.hasAttribute(attrState)) {
this.attachForm(el)
}
break