diff options
author | alecpl <alec@alec.pl> | 2010-06-18 19:56:00 +0000 |
---|---|---|
committer | alecpl <alec@alec.pl> | 2010-06-18 19:56:00 +0000 |
commit | e2b0a0018c106a3982865ed3f1496be45b9e8368 (patch) | |
tree | 85da78fdc936fdca63893f2b90b288bc238b1064 /skins/default | |
parent | 176c76c4310bfbba64d1f1f0f8679de5dbcbe78e (diff) |
- Hide popup menus when clicking in iframes (#1486807)
Diffstat (limited to 'skins/default')
-rw-r--r-- | skins/default/functions.js | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/skins/default/functions.js b/skins/default/functions.js index 4ef069b88..c222ae4ab 100644 --- a/skins/default/functions.js +++ b/skins/default/functions.js @@ -368,9 +368,22 @@ function rcube_init_mail_ui() rcmail_ui = new rcube_mail_ui(); rcube_event.add_listener({ object:rcmail_ui, method:'body_mouseup', event:'mouseup' }); rcube_event.add_listener({ object:rcmail_ui, method:'body_keypress', event:'keypress' }); + + $('iframe').load(iframe_events) + .contents().mouseup(function(e){parent.rcmail_ui.body_mouseup(e)}); + if (rcmail.env.task == 'mail') { rcmail.addEventListener('menu-open', 'open_listmenu', rcmail_ui); rcmail.addEventListener('menu-save', 'save_listmenu', rcmail_ui); rcmail.gui_object('message_dragmenu', 'dragmessagemenu'); } } + +// Events handling in iframes (eg. preview pane) +function iframe_events() +{ + // this==iframe + var doc = this.contentDocument ? this.contentDocument : this.contentWindow ? this.contentWindow.document : null; + parent.rcube_event.add_listener({ element: doc, object:rcmail_ui, method:'body_mouseup', event:'mouseup' }); +} + |