| | |
| | | messagemenu:'messagemenu', |
| | | listmenu:'listmenu', |
| | | dragmessagemenu:'dragmessagemenu', |
| | | groupmenu:'groupoptionsmenu' |
| | | groupmenu:'groupoptionsmenu', |
| | | mailboxmenu:'mailboxoptionsmenu' |
| | | }; |
| | | |
| | | var obj; |
| | |
| | | show_groupmenu: function(show) |
| | | { |
| | | this.show_popupmenu(this.groupmenu, 'groupactionslink', show, true); |
| | | }, |
| | | |
| | | show_mailboxmenu: function(show) |
| | | { |
| | | this.show_popupmenu(this.mailboxmenu, 'mboxactionslink', show, true); |
| | | }, |
| | | |
| | | show_searchmenu: function(show) |
| | |
| | | this.dragmessagemenu.hide(); |
| | | else if (this.groupmenu && this.groupmenu.is(':visible') && target != rcube_find_object('groupactionslink')) |
| | | this.show_groupmenu(false); |
| | | else if (this.mailboxmenu && this.mailboxmenu.is(':visible') && target != rcube_find_object('mboxactionslink')) |
| | | this.show_mailboxmenu(false); |
| | | else if (this.listmenu && this.listmenu.is(':visible') && target != rcube_find_object('listmenulink')) { |
| | | var menu = rcube_find_object('listmenu'); |
| | | while (target.parentNode) { |
| | |
| | | this[k].hide(); |
| | | } |
| | | } |
| | | }, |
| | | |
| | | switch_preview_pane: function(elem) |
| | | { |
| | | var uid, prev_frm = $('#mailpreviewframe'); |
| | | |
| | | if (elem.checked) { |
| | | rcmail.env.contentframe = 'messagecontframe'; |
| | | if (mailviewsplit.layer) { |
| | | mailviewsplit.resize(); |
| | | mailviewsplit.layer.elm.style.display = ''; |
| | | } else |
| | | mailviewsplit.init(); |
| | | prev_frm.show(); |
| | | if (uid = rcmail.message_list.get_single_selection()) |
| | | rcmail.show_message(uid, false, true); |
| | | rcmail.http_post('save-pref', '_name=preview_pane&_value=1'); |
| | | } else { |
| | | prev_frm.hide(); |
| | | if (bw.ie6 || bw.ie7) { |
| | | var fr = document.getElementById('mailcontframe'); |
| | | fr.style.bottom = 0; |
| | | fr.style.height = parseInt(fr.parentNode.offsetHeight)+'px'; |
| | | } |
| | | else |
| | | $('#mailcontframe').css({height: 'auto', bottom: 0}); |
| | | if (mailviewsplit.layer) |
| | | mailviewsplit.layer.elm.style.display = 'none'; |
| | | rcmail.env.contentframe = null; |
| | | rcmail.show_contentframe(false); |
| | | rcmail.http_post('save-pref', '_name=preview_pane&_value=0'); |
| | | } |
| | | } |
| | | |
| | | }; |
| | |
| | | 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' }); |
| | | } |
| | | |