From 32169fba664ed941a8e26c4acf5b0b14883f235b Mon Sep 17 00:00:00 2001 From: Daniel Molina Date: Tue, 21 Jan 2014 17:52:54 +0100 Subject: [PATCH] feature #2589: Show Image and Template ID when a new resource is created --- src/sunstone/public/js/plugins/images-tab.js | 4 ++-- src/sunstone/public/js/plugins/templates-tab.js | 4 ++-- src/sunstone/public/js/sunstone-util.js | 5 +++++ 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/sunstone/public/js/plugins/images-tab.js b/src/sunstone/public/js/plugins/images-tab.js index 7444a0d4e5..1c80a61bf7 100644 --- a/src/sunstone/public/js/plugins/images-tab.js +++ b/src/sunstone/public/js/plugins/images-tab.js @@ -347,9 +347,9 @@ var image_actions = { callback: function(request, response){ addImageElement(request, response); $create_image_dialog.trigger("reveal:close") + notifyCustom(tr("Image created "), "ID: " + response.IMAGE.ID, false) }, - error: onError, - notify:true + error: onError }, "Image.create_dialog" : { diff --git a/src/sunstone/public/js/plugins/templates-tab.js b/src/sunstone/public/js/plugins/templates-tab.js index 0c7246d29a..c68fbf27f8 100644 --- a/src/sunstone/public/js/plugins/templates-tab.js +++ b/src/sunstone/public/js/plugins/templates-tab.js @@ -315,9 +315,9 @@ var template_actions = { $create_template_dialog.trigger("reveal:close") $create_template_dialog.empty(); addTemplateElement(request, response); + notifyCustom(tr("Template created "), "ID: " + response.VMTEMPLATE.ID, false) }, - error: onError, - notify:true + error: onError }, "Template.create_dialog" : { diff --git a/src/sunstone/public/js/sunstone-util.js b/src/sunstone/public/js/sunstone-util.js index 5c254e2b08..e97339c702 100644 --- a/src/sunstone/public/js/sunstone-util.js +++ b/src/sunstone/public/js/sunstone-util.js @@ -336,6 +336,11 @@ function notifyMessage(msg){ $.jGrowl(msg, {theme: "jGrowl-notify-submit", position: "bottom-right"}); } +function notifyCustom(title, msg, sticky) { + msg = "

" + title + "

" + msg; + $.jGrowl(msg, {theme: "jGrowl-notify-submit", position: "bottom-right", sticky: sticky }); +} + // Returns an HTML string with the json keys and values // Attempts to css format output, giving different values to // margins etc. according to depth level etc.