summaryrefslogtreecommitdiff
path: root/skins/larry/ui.js
diff options
context:
space:
mode:
authorthomascube <thomas@roundcube.net>2012-01-05 12:12:18 +0000
committerthomascube <thomas@roundcube.net>2012-01-05 12:12:18 +0000
commit0e530bd9203e79218e9aad631e8495794a72a042 (patch)
treea3cd2627be1ca9ee1ae78b5593aca7d6f4cb60aa /skins/larry/ui.js
parent1c4f23d6e58e12f93d8de2c3ae416df575e8ad85 (diff)
Show additional popup dialog on error messages
Diffstat (limited to 'skins/larry/ui.js')
-rw-r--r--skins/larry/ui.js36
1 files changed, 36 insertions, 0 deletions
diff --git a/skins/larry/ui.js b/skins/larry/ui.js
index c43198aa5..ee51500e7 100644
--- a/skins/larry/ui.js
+++ b/skins/larry/ui.js
@@ -58,6 +58,8 @@ function rcube_mail_ui()
*/
function init()
{
+ rcmail.addEventListener('message', message_displayed);
+
if (rcmail.env.task == 'mail') {
rcmail.addEventListener('menu-open', show_listoptions);
rcmail.addEventListener('menu-save', save_listoptions);
@@ -198,6 +200,39 @@ function rcube_mail_ui()
}
/**
+ * Triggered when a new user message is displayed
+ */
+ function message_displayed(p)
+ {
+ // show a popup dialog on errors
+ if (p.type == 'error') {
+ if (!me.messagedialog) {
+ me.messagedialog = $('<div>').addClass('popupdialog');
+ }
+
+ var pos = $(p.object).offset();
+ me.messagedialog.dialog('close');
+ me.messagedialog.html(p.message)
+ .dialog({
+ resizable: false,
+ closeOnEscape: true,
+ dialogClass: 'popupmessage ' + p.type,
+ title: null,
+ close: function() {
+ me.messagedialog.dialog('destroy').hide();
+ },
+ position: ['center', pos.top - 160],
+ hide: { effect:'drop', direction:'down' },
+ width: 420,
+ minHeight: 90
+ }).show();
+
+ window.setTimeout(function(){ me.messagedialog.dialog('close'); }, p.timeout / 2);
+ }
+ }
+
+
+ /**
* Adjust UI objects of the mail view screen
*/
function layout_messageview()
@@ -214,6 +249,7 @@ function rcube_mail_ui()
function render_mailboxlist(splitter)
{
+ // TODO: implement smart shortening of long folder names
}