diff --git a/src/sunstone/public/app/sunstone.js b/src/sunstone/public/app/sunstone.js index 07a9258b8b..c8391c894e 100644 --- a/src/sunstone/public/app/sunstone.js +++ b/src/sunstone/public/app/sunstone.js @@ -699,6 +699,7 @@ define(function(require) { var context = $("#" + tabId); _popFormPanelLoading(tabId); _enableFormPanelSubmit(tabId); + _showFormPanelSubmit(tabId); setTimeout(function() { var tab = SunstoneCfg["tabs"][tabId]; @@ -844,6 +845,16 @@ define(function(require) { off("click.disable"); } + function _hideFormPanelSubmit(tabId) { + var context = $("#" + tabId); + $(".submit_button", context).hide(); + } + + function _showFormPanelSubmit(tabId) { + var context = $("#" + tabId); + $(".submit_button", context).show(); + } + var _getButton = function(tadId, buttonName) { var button = null; var buttons = SunstoneCfg["tabs"][tadId]["buttons"]; @@ -905,6 +916,8 @@ define(function(require) { "hideFormPanelLoading": _hideFormPanelLoading, "disableFormPanelSubmit": _disableFormPanelSubmit, "enableFormPanelSubmit": _enableFormPanelSubmit, + "hideFormPanelSubmit": _hideFormPanelSubmit, + "showFormPanelSubmit": _showFormPanelSubmit, "rightInfoVisible": _rightInfoVisible, diff --git a/src/sunstone/public/app/tabs/hosts-tab/form-panels/create.js b/src/sunstone/public/app/tabs/hosts-tab/form-panels/create.js index 2610886b08..7c1f01f49b 100644 --- a/src/sunstone/public/app/tabs/hosts-tab/form-panels/create.js +++ b/src/sunstone/public/app/tabs/hosts-tab/form-panels/create.js @@ -83,19 +83,19 @@ define(function(require) { $(".vcenter_credentials", context).hide(); $("#vnm_mads", context).show(); $("#name_container", context).show(); - $("#"+TAB_ID+"submit_button", "#"+TAB_ID).show(); + Sunstone.showFormPanelSubmit(TAB_ID); $(".drivers", context).show(); } else if (this.value == "vcenter") { $("#vnm_mads", context).hide(); $("#name_container", context).hide(); $(".vcenter_credentials", context).show(); - $("#"+TAB_ID+"submit_button", "#"+TAB_ID).hide(); + Sunstone.hideFormPanelSubmit(TAB_ID); $(".drivers", context).hide(); } else { $(".vcenter_credentials", context).hide(); $("#vnm_mads", context).show(); $("#name_container", context).show(); - $("#"+TAB_ID+"submit_button", "#"+TAB_ID).show(); + Sunstone.showFormPanelSubmit(TAB_ID); $(".drivers", context).hide(); } });