allow dom level 1 events to be removed #1385
This commit is contained in:
parent
bc0a75a6a2
commit
ff7ce37476
3 changed files with 5 additions and 1 deletions
|
|
@ -500,7 +500,7 @@ module.exports = function($window) {
|
||||||
if (typeof onevent === "function") onevent.call(element, e)
|
if (typeof onevent === "function") onevent.call(element, e)
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
if (key in element) element[key] = callback
|
if (key in element) element[key] = typeof value === "function" ? callback : null
|
||||||
else {
|
else {
|
||||||
var eventName = key.slice(2)
|
var eventName = key.slice(2)
|
||||||
if (vnode.events === undefined) vnode.events = {}
|
if (vnode.events === undefined) vnode.events = {}
|
||||||
|
|
|
||||||
|
|
@ -237,6 +237,7 @@ module.exports = function() {
|
||||||
}
|
}
|
||||||
if (typeof this["on" + e.type] === "function" && !isModernEvent(e.type)) this["on" + e.type](e)
|
if (typeof this["on" + e.type] === "function" && !isModernEvent(e.type)) this["on" + e.type](e)
|
||||||
},
|
},
|
||||||
|
onclick: null,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (element.nodeName === "A") {
|
if (element.nodeName === "A") {
|
||||||
|
|
|
||||||
|
|
@ -559,6 +559,9 @@ o.spec("domMock", function() {
|
||||||
$document.body.removeChild(div)
|
$document.body.removeChild(div)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
o("has onclick", function() {
|
||||||
|
o("onclick" in div).equals(true)
|
||||||
|
})
|
||||||
o("addEventListener works", function() {
|
o("addEventListener works", function() {
|
||||||
div.addEventListener("click", spy, false)
|
div.addEventListener("click", spy, false)
|
||||||
div.dispatchEvent(e)
|
div.dispatchEvent(e)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue