Bug #9010: IE doesn't bubble change events
authorMichael M Slusarz <slusarz@curecanti.org>
Mon, 10 May 2010 20:51:04 +0000 (14:51 -0600)
committerMichael M Slusarz <slusarz@curecanti.org>
Mon, 10 May 2010 20:51:04 +0000 (14:51 -0600)
imp/js/compose-dimp.js

index 3667626..d973cd4 100644 (file)
@@ -869,7 +869,12 @@ var DimpCompose = {
         }
 
         /* Attach event handlers. */
-        document.observe('change', this.changeHandler.bindAsEventListener(this));
+        if (Prototype.Browser.IE) {
+            // IE doesn't bubble change events.
+            $('identity', 'upload').invoke('observe', 'change', this.changeHandler.bindAsEventListener(this));
+        } else {
+            document.observe('change', this.changeHandler.bindAsEventListener(this));
+        }
         Event.observe(window, 'resize', this.resizeMsgArea.bind(this));
         $('compose').observe('submit', Event.stop);
         $('submit_frame').observe('load', this.attachmentComplete.bind(this));