Add parseDOM & (new) parseElement proto methods
This commit is contained in:
1 parent
90615f8ac8
commit
acc3d87911
3 files changed
+39
No files matched your search
@@ -0,0 +1,7 @@
|
||||
var forEachEls = require("../foreach-els")
|
||||
|
||||
var parseElement = require("../parse-element")
|
||||
|
||||
module.exports = function(el) {
|
||||
forEachEls(this.getElements(el), parseElement }, this)
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
module.exports = function(el) {
|
||||
switch (el.tagName.toLowerCase()) {
|
||||
case "a":
|
||||
this.attachLink(el)
|
||||
break
|
||||
|
||||
case "form":
|
||||
throw "Pjax doesnt support <form> yet."
|
||||
break
|
||||
|
||||
default:
|
||||
throw "Pjax can only be applied on <a> or <form> submit"
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user