Code cleanup
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -65,7 +65,7 @@ tape("test attach form preventDefaulted events", function(t) {
|
||||
var loadUrlCalled = false
|
||||
var form = document.createElement("form")
|
||||
|
||||
// This needs to be before the call to attachFormk()
|
||||
// This needs to be before the call to attachForm()
|
||||
on(form, "submit", function(event) { event.preventDefault() })
|
||||
|
||||
attachForm.call({
|
||||
|
||||
Reference in New Issue
Block a user