summaryrefslogtreecommitdiff
path: root/skins/default/functions.js
diff options
context:
space:
mode:
authorthomascube <thomas@roundcube.net>2011-01-18 18:00:57 +0000
committerthomascube <thomas@roundcube.net>2011-01-18 18:00:57 +0000
commit0501b637a3177cce441166b5fcfe27c9bd9fbe0f (patch)
tree5460128ef65d2510a7538c4a0e7336987e090ca1 /skins/default/functions.js
parente81a30752b244394b03cbcaa0df254c93b379782 (diff)
Merge branch devel-addressbook (r4193:4382) back into trunk
Diffstat (limited to 'skins/default/functions.js')
-rw-r--r--skins/default/functions.js21
1 files changed, 12 insertions, 9 deletions
diff --git a/skins/default/functions.js b/skins/default/functions.js
index 00e97fd1a..62e4783cb 100644
--- a/skins/default/functions.js
+++ b/skins/default/functions.js
@@ -25,9 +25,8 @@ function rcube_show_advanced(visible)
// Warning: don't place "caller" <script> inside page element (id)
function rcube_init_tabs(id, current)
{
- var content = document.getElementById(id),
- // get fieldsets of the higher-level (skip nested fieldsets)
- fs = $('fieldset', content).not('fieldset > fieldset');
+ var content = $('#'+id),
+ fs = content.children('fieldset');
if (!fs.length)
return;
@@ -42,9 +41,7 @@ function rcube_init_tabs(id, current)
// convert fildsets into tabs
fs.each(function(idx) {
- var tab, a, elm = $(this),
- // get first legend element
- legend = $(elm).children('legend');
+ var tab, a, elm = $(this), legend = elm.children('legend');
// create a tab
a = $('<a>').text(legend.text()).attr('href', '#');
@@ -66,8 +63,7 @@ function rcube_init_tabs(id, current)
function rcube_show_tab(id, index)
{
- var content = document.getElementById(id),
- fs = $('fieldset', content).not('fieldset > fieldset');
+ var fs = $('#'+id).children('fieldset');
fs.each(function(idx) {
// Show/hide fieldset (tab content)
@@ -94,7 +90,8 @@ function rcube_mail_ui()
mailboxmenu: {id:'mailboxoptionsmenu', above:1},
composemenu: {id:'composeoptionsmenu', editable:1},
// toggle: #1486823, #1486930
- uploadmenu: {id:'attachment-form', editable:1, above:1, toggle:!bw.ie&&!bw.linux }
+ uploadmenu: {id:'attachment-form', editable:1, above:1, toggle:!bw.ie&&!bw.linux },
+ uploadform: {id:'upload-form', editable:1, toggle:!bw.ie&&!bw.linux }
};
var obj;
@@ -136,6 +133,9 @@ show_popupmenu: function(popup, show)
if (!above && pos.top + ref.offsetHeight + obj.height() > window.innerHeight)
above = true;
+ if (pos.left + obj.width() > window.innerWidth)
+ pos.left = window.innerWidth - obj.width() - 30;
+
obj.css({ left:pos.left, top:(pos.top + (above ? -obj.height() : ref.offsetHeight)) });
}
@@ -500,6 +500,9 @@ function rcube_init_mail_ui()
if (rcmail.env.action == 'compose')
rcmail_ui.init_compose_form();
}
+ else if (rcmail.env.task == 'addressbook') {
+ rcmail.addEventListener('afterupload-photo', function(){ rcmail_ui.show_popup('uploadform', false); });
+ }
}
// Events handling in iframes (eg. preview pane)