diff --git a/editor/js/ui/notifications.js b/editor/js/ui/notifications.js index 7c17741ea..5a2070f77 100644 --- a/editor/js/ui/notifications.js +++ b/editor/js/ui/notifications.js @@ -14,9 +14,49 @@ * limitations under the License. **/ RED.notify = (function() { + + /* + // Example usage for a modal dialog with buttons + var myNotification = RED.notify("This is the message to display",{ + modal: true, + fixed: true, + type: 'warning', + buttons: [ + { + text: "cancel", + click: function(e) { + myNotification.close(); + } + }, + { + text: "okay", + class:"primary", + click: function(e) { + myNotification.close(); + } + } + ] + }); + */ + var currentNotifications = []; var c = 0; return function(msg,type,fixed,timeout) { + var options = {}; + if (type !== null && typeof type === 'object') { + options = type; + fixed = options.fixed; + timeout = options.timeout; + type = options.type; + } + + if (options.modal) { + $("#header-shade").show(); + $("#editor-shade").show(); + $("#palette-shade").show(); + $(".sidebar-shade").show(); + } + if (currentNotifications.length > 4) { var ll = currentNotifications.length; for (var i = 0;ll > 4 && i').appendTo(n) + options.buttons.forEach(function(buttonDef) { + var b = $('