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:
mkanat%bugzilla.org 2011-06-14 10:08:53 +00:00
parent b7cdcf951b
commit abd9ccffe1
2 changed files with 8 additions and 7 deletions

View File

@ -1 +1 @@
7604
7605

View File

@ -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);
}
/**