##// END OF EJS Templates
release: updated pip2nix output for 4.5.2
release: updated pip2nix output for 4.5.2

File last commit:

r882:d869b56a default
r1250:056375d2 stable
Show More
rhodecode-toast.js
40 lines | 1.1 KiB | application/javascript | JavascriptLexer
Polymer({
is: 'rhodecode-toast',
properties: {
toasts: {
type: Array,
value: function(){
return []
}
}
},
observers: [
'_changedToasts(toasts.splices)'
],
_changedToasts: function(newValue, oldValue){
this.$['p-toast'].notifyResize();
$.Topic('/favicon/update').publish({count: this.toasts.length});
},
dismissNotifications: function(){
this.$['p-toast'].close();
$.Topic('/favicon/update').publish({count: 0});
},
handleClosed: function(){
this.splice('toasts', 0);
},
open: function(){
this.$['p-toast'].open();
},
handleNotification: function(data){
if (!templateContext.rhodecode_user.notification_status && !data.message.force) {
// do not act if notifications are disabled
return
}
this.push('toasts',{
level: data.message.level,
message: data.message.message
});
this.open();
},
_gettext: _gettext
});