2014-05-06 08:19:23 +02:00
|
|
|
module.exports = function(el) {
|
|
|
|
|
switch (el.tagName.toLowerCase()) {
|
|
|
|
|
case "a":
|
2015-01-21 00:11:59 -08:00
|
|
|
// only attach link if el does not already have link attached
|
2015-01-28 18:27:16 -08:00
|
|
|
if (!el.hasAttribute('data-pjax-click-state')) {
|
2015-01-21 00:11:59 -08:00
|
|
|
this.attachLink(el)
|
|
|
|
|
}
|
2014-05-06 08:19:23 +02:00
|
|
|
break
|
|
|
|
|
|
|
|
|
|
case "form":
|
|
|
|
|
throw "Pjax doesnt support <form> yet."
|
|
|
|
|
break
|
|
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
throw "Pjax can only be applied on <a> or <form> submit"
|
|
|
|
|
}
|
|
|
|
|
}
|