summaryrefslogtreecommitdiff
path: root/skins/larry/ui.js
diff options
context:
space:
mode:
authorAleksander Machniak <alec@alec.pl>2014-06-26 12:32:52 +0200
committerAleksander Machniak <alec@alec.pl>2014-06-26 12:32:52 +0200
commitc5f06896d4db5f2479b5988cb2cea6ef0fa80cad (patch)
tree27a34963be1c24bb8e6885ae7e4cc9186783d60c /skins/larry/ui.js
parent1a3132366e42a514ea9c471928eef8a63953125a (diff)
Display full quota information in popup (#1485769, #1486604)
Diffstat (limited to 'skins/larry/ui.js')
-rw-r--r--skins/larry/ui.js15
1 files changed, 13 insertions, 2 deletions
diff --git a/skins/larry/ui.js b/skins/larry/ui.js
index 11125c389..f67b42250 100644
--- a/skins/larry/ui.js
+++ b/skins/larry/ui.js
@@ -515,14 +515,25 @@ function rcube_mail_ui()
function update_quota(p)
{
- var step = 24, step_count = 20,
+ var element = $('#quotadisplay'), menu = $('#quotamenu'),
+ step = 24, step_count = 20,
y = p.total ? Math.ceil(p.percent / 100 * step_count) * step : 0;
// never show full-circle if quota is close to 100% but below.
if (p.total && y == step * step_count && p.percent < 100)
y -= step;
- $('#quotadisplay').css('background-position', '0 -'+y+'px');
+ element.css('background-position', '0 -' + y + 'px');
+
+ if (p.table) {
+ if (!menu.length)
+ menu = $('<div id="quotamenu" class="popupmenu">').appendTo($('body'));
+
+ menu.html(p.table);
+ element.css('cursor', 'pointer').off('click').on('click', function(e) {
+ return rcmail.command('menu-open', 'quotamenu', e.target, e);
+ });
+ }
}