Add parseDOM & (new) parseElement proto methods

This commit is contained in:
Maxime Thirouin
2014-05-06 08:19:23 +02:00
parent 3f3fa761e1
commit 681aa74e1d
3 changed files with 39 additions and 0 deletions

View File

@@ -0,0 +1,7 @@
var forEachEls = require("../foreach-els")
var parseElement = require("../parse-element")
module.exports = function(el) {
forEachEls(this.getElements(el), parseElement }, this)
}

View File

@@ -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"
}
}