projects
/
arvados.git
/ blobdiff
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Bug fix since recent commits to master where Textile was not being rendered any more...
[arvados.git]
/
apps
/
workbench
/
app
/
assets
/
javascripts
/
users.js
diff --git
a/apps/workbench/app/assets/javascripts/users.js
b/apps/workbench/app/assets/javascripts/users.js
index c9c69a0a64529860adf022b6925713b1a454f5bb..ee1c7dda37af86e7eb1719791a29052920b6673d 100644
(file)
--- a/
apps/workbench/app/assets/javascripts/users.js
+++ b/
apps/workbench/app/assets/javascripts/users.js
@@
-1,8
+1,15
@@
$(document).
$(document).
+ on('notifications:recount',
+ function() {
+ var menu = $('.notification-menu');
+ n = $('.notification', menu).not('.empty').length;
+ $('.notification-count', menu).html(n>0 ? n : '');
+ }).
on('ajax:success', 'form.new_authorized_key',
function(e, data, status, xhr) {
on('ajax:success', 'form.new_authorized_key',
function(e, data, status, xhr) {
- $(e.target).parents('div.daxalert').fadeOut('slow', function() {
- $('<div class="alert alert-success daxalert"><button type="button" class="close" data-dismiss="alert">×</button><p>Key added.</p></div>').hide().replaceAll(this).fadeIn('slow');
+ $(e.target).parents('.notification').eq(0).fadeOut('slow', function() {
+ $('<li class="alert alert-success daxalert">SSH key added.</li>').hide().replaceAll(this).fadeIn('slow');
+ $(document).trigger('notifications:recount');
});
}).
on('ajax:complete', 'form.new_authorized_key',
});
}).
on('ajax:complete', 'form.new_authorized_key',