From 27a67b8e2973ba10640adbf3836a6faca0cf2964 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mart=C3=ADn?= Date: Tue, 17 May 2016 16:13:30 +0200 Subject: [PATCH] Fix sunstone dialog reset on submit Because of the setTimeout sometimes the form panel reset finished after the back button was clicked, opening the form panel after a submit --- src/sunstone/public/app/sunstone.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/sunstone/public/app/sunstone.js b/src/sunstone/public/app/sunstone.js index ae9fc179bb..cc20cf0774 100644 --- a/src/sunstone/public/app/sunstone.js +++ b/src/sunstone/public/app/sunstone.js @@ -930,7 +930,9 @@ define(function(require) { formPanelInstance.reset(context); } - _showFormPanel(tabId, formPanelId); + if (_formPanelVisible($("#"+tabId))){ + _showFormPanel(tabId, formPanelId); + } }, 13) } @@ -1032,6 +1034,10 @@ define(function(require) { return $(".sunstone-list", context).is(':visible'); } + var _formPanelVisible = function(context) { + return $(".sunstone-form", context).is(':visible'); + } + var _rightInfoResourceId = function(context) { return $(".resource-id", context).text(); }