Bug 656769: Fix bz_fireEvent for IE9
r=mkanat, a=mkanat git-svn-id: svn://10.0.0.236/branches/BUGZILLA-4_0-BRANCH@262394 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
parent
b7cdcf951b
commit
abd9ccffe1
@ -1 +1 @@
|
||||
7604
|
||||
7605
|
||||
@ -243,15 +243,16 @@ function bz_optionIndex(aSelect, aValue) {
|
||||
* without the word "on" in front of it.
|
||||
*/
|
||||
function bz_fireEvent(anElement, anEvent) {
|
||||
// IE
|
||||
if (document.createEventObject) {
|
||||
if (document.createEvent) {
|
||||
// DOM-compliant browser
|
||||
var evt = document.createEvent("HTMLEvents");
|
||||
evt.initEvent(anEvent, true, true);
|
||||
return !anElement.dispatchEvent(evt);
|
||||
} else {
|
||||
// IE
|
||||
var evt = document.createEventObject();
|
||||
return anElement.fireEvent('on' + anEvent, evt);
|
||||
}
|
||||
// Firefox, etc.
|
||||
var evt = document.createEvent("HTMLEvents");
|
||||
evt.initEvent(anEvent, true, true); // event type, bubbling, cancelable
|
||||
return !anElement.dispatchEvent(evt);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user