summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorByron Jones <bjones@mozilla.com>2011-06-14 11:57:10 +0200
committerByron Jones <bjones@mozilla.com>2011-06-14 11:57:10 +0200
commitf6f78c6ea20839950921d17792758cc904fbfdf9 (patch)
treeabfc539e4f298532d14d0d4dd0430fc09c5da015
parent79542d43011ee798f0b9b72976b6cb0ef033b84f (diff)
downloadbugzilla-f6f78c6ea20839950921d17792758cc904fbfdf9.tar.gz
bugzilla-f6f78c6ea20839950921d17792758cc904fbfdf9.tar.xz
Bug 656769: Fix bz_fireEvent for IE9
r=mkanat, a=mkanat
-rw-r--r--js/util.js13
1 files changed, 7 insertions, 6 deletions
diff --git a/js/util.js b/js/util.js
index 666f2666b..6dcabbbc9 100644
--- a/js/util.js
+++ b/js/util.js
@@ -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);
}
/**