From 8e739beee20c4a1579696dbe2ce10acef74aa221 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mart=C3=ADn?= Date: Mon, 24 Mar 2014 12:12:14 +0100 Subject: [PATCH] Bug #2791 #2778: Do not close modal windows on refresh --- src/sunstone/public/js/sunstone.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/sunstone/public/js/sunstone.js b/src/sunstone/public/js/sunstone.js index e437881fbc..c9507bfead 100644 --- a/src/sunstone/public/js/sunstone.js +++ b/src/sunstone/public/js/sunstone.js @@ -710,7 +710,7 @@ function insertButtonsInTab(tab_name, panel_name, panel_buttons, custom_context) case "refresh": context = $("#"+custom_id+"refresh_buttons", buttons_row); text = ''; - str_class.push("secondary", "button", "small", "radius"); + str_class.push("refresh", "secondary", "button", "small", "radius"); button_code = ''; break; case "top": @@ -3615,7 +3615,9 @@ $(document).ready(function(){ value = $(this).attr('href'); } - $(document).foundation('dropdown', 'closeall'); + if(!$(this).hasClass("refresh")){ + $(document).foundation('dropdown', 'closeall'); + } var action = SunstoneCfg["actions"][value]; if (!action) { @@ -3632,7 +3634,7 @@ $(document).ready(function(){ error = Sunstone.runAction(value); } - if (!error){ + if (!error && !$(this).hasClass("refresh")){ //proceed to close confirm dialog in //case it was open $('div#confirm_dialog').foundation('reveal', 'close');