diff options
Diffstat (limited to 'skins/larry/ui.js')
-rw-r--r-- | skins/larry/ui.js | 81 |
1 files changed, 62 insertions, 19 deletions
diff --git a/skins/larry/ui.js b/skins/larry/ui.js index f7428f4da..e5733bd23 100644 --- a/skins/larry/ui.js +++ b/skins/larry/ui.js @@ -19,7 +19,7 @@ function rcube_mail_ui() searchmenu: { editable:1, callback:searchmenu }, attachmentmenu: { }, listoptions: { editable:1 }, - dragmessagemenu: { sticky:1 }, + dragmenu: { sticky:1 }, groupmenu: { above:1 }, mailboxmenu: { above:1 }, spellmenu: { callback: spellmenu }, @@ -90,8 +90,8 @@ function rcube_mail_ui() var dragmenu = $('#dragmessagemenu'); if (dragmenu.length) { - rcmail.gui_object('message_dragmenu', 'dragmessagemenu'); - popups.dragmessagemenu = dragmenu; + rcmail.gui_object('dragmenu', 'dragmessagemenu'); + popups.dragmenu = dragmenu; } if (rcmail.env.action == 'show' || rcmail.env.action == 'preview') { @@ -152,6 +152,11 @@ function rcube_mail_ui() rcmail.addEventListener('setquota', update_quota); rcmail.addEventListener('enable-command', enable_command); + rcmail.addEventListener('afterimport-messages', show_uploadform); + } + else if (rcmail.env.action == 'get') { + new rcube_splitter({ id:'mailpartsplitterv', p1:'#messagepartheader', p2:'#messagepartcontainer', + orientation:'v', relative:true, start:226, min:150, size:12}).init(); } if ($('#mailview-left').length) { @@ -190,6 +195,8 @@ function rcube_mail_ui() /*** addressbook task ***/ else if (rcmail.env.task == 'addressbook') { rcmail.addEventListener('afterupload-photo', show_uploadform); + rcmail.addEventListener('beforepushgroup', push_contactgroup); + rcmail.addEventListener('beforepopgroup', pop_contactgroup); if (rcmail.env.action == '') { new rcube_splitter({ id:'addressviewsplitterd', p1:'#addressview-left', p2:'#addressview-right', @@ -199,12 +206,12 @@ function rcube_mail_ui() new rcube_scroller('#directorylist-content', '#directorylist-header', '#directorylist-footer'); } - } - // set min-width to show all toolbar buttons - var screen = $('.minwidth'); - if (screen.length) { - screen.css('min-width', $('.toolbar').width() + $('#quicksearchbar').parent().width() + 20); + var dragmenu = $('#dragcontactmenu'); + if (dragmenu.length) { + rcmail.gui_object('dragmenu', 'dragcontactmenu'); + popups.dragmenu = dragmenu; + } } // turn a group of fieldsets into tabs @@ -218,6 +225,7 @@ function rcube_mail_ui() } var select = $(this), + parent = select.parent(), height = Math.max(select.height(), 26) - 2, width = select.width() - 22, title = $('option', this).first().text(); @@ -232,20 +240,23 @@ function rcube_mail_ui() overlay.children().width(width).height(height).css('line-height', (height - 1) + 'px'); - select.change(function() { - var val = $('option:selected', this).text(); - $(this).next().children().html(val); - }); - - var parent = select.parent(); if (parent.css('position') != 'absolute') parent.css('position', 'relative'); // re-set original select width to fix click action and options width in some browsers - if (!bw.mz) - select.width(overlay.width()); + select.width(overlay.width()) + .change(function() { + var val = $('option:selected', this).text(); + $(this).next().children().text(val); + }); }); + // set min-width to show all toolbar buttons + var screen = $('body > div.minwidth'); + if (screen.length) { + screen.css('min-width', $('.toolbar').width() + $('#quicksearchbar').width() + $('#searchfilter').width() + 30); + } + $(document.body) .bind('mouseup', body_mouseup) .bind('keyup', function(e){ @@ -589,8 +600,11 @@ function rcube_mail_ui() mailviewsplit.handle.hide(); } - if (visible && uid && rcmail.message_list) - rcmail.message_list.scrollto(uid); + if (rcmail.message_list) { + if (visible && uid) + rcmail.message_list.scrollto(uid); + rcmail.message_list.resize(); + } rcmail.command('save-pref', { name:'preview_pane', value:(visible?1:0) }); } @@ -824,6 +838,35 @@ function rcube_mail_ui() }); } + function push_contactgroup(p) + { + // lets the contacts list swipe to the left, nice! + var table = $('#contacts-table'), + scroller = table.parent().css('overflow', 'hidden'); + + table.clone() + .css({ position:'absolute', top:'0', left:'0', width:table.width()+'px', 'z-index':10 }) + .appendTo(scroller) + .animate({ left: -(table.width()+5) + 'px' }, 300, 'swing', function(){ + $(this).remove(); + scroller.css('overflow', 'auto') + }); + } + + function pop_contactgroup(p) + { + // lets the contacts list swipe to the left, nice! + var table = $('#contacts-table'), + scroller = table.parent().css('overflow', 'hidden'), + clone = table.clone().appendTo(scroller); + + table.css({ position:'absolute', top:'0', left:-(table.width()+5) + 'px', width:table.width()+'px', height:table.height()+'px', 'z-index':10 }) + .animate({ left:'0' }, 300, 'linear', function(){ + clone.remove(); + $(this).css({ position:'relative', left:'0', width:'100%', height:'auto', 'z-index':1 }); + scroller.css('overflow', 'auto') + }); + } function show_uploadform() { @@ -834,7 +877,7 @@ function rcube_mail_ui() $dialog.dialog('close'); return; } - + // add icons to clone file input field if (rcmail.env.action == 'compose' && !$dialog.data('extended')) { $('<a>') |