mirror of https://github.com/apache/cloudstack.git
UI widgets: support event-based notifications
Triggering 'cloudStack.addNotification' adds a new UI notification, to
avoid having to specify DOM element containing the jQuery widget every
time. This event accepts same args as .notifications('add', ...)
Example:
$(window).trigger('cloudStack.addNotification', {
desc: 'Description',
interval: 1000,
poll: function(args) {
...
args.complete();
}
});
This commit is contained in:
parent
93fcd024a5
commit
c60501e950
|
|
@ -230,7 +230,11 @@
|
|||
return this;
|
||||
};
|
||||
|
||||
// Events
|
||||
// Setup notification listener -- accepts same args as
|
||||
$(window).bind('cloudStack.addNotification', function(event, data) {
|
||||
$('.notifications').notifications('add', data);
|
||||
});
|
||||
|
||||
$(document).click(function(event) {
|
||||
var $target = $(event.target);
|
||||
var $attachTo, $popup;
|
||||
|
|
|
|||
Loading…
Reference in New Issue