diff --git a/src/sunstone/public/app/sunstone.js b/src/sunstone/public/app/sunstone.js index 36274df4bbc..39a06936d7e 100644 --- a/src/sunstone/public/app/sunstone.js +++ b/src/sunstone/public/app/sunstone.js @@ -116,20 +116,24 @@ define(function(require) { }); }; + var _addAction = function(i=null, tabName){ + var name = "./tabs/" + tabName; + if (DefaultTabsArr.indexOf(tabName) == -1){ + name = "./addons/tabs/" + tabName; + } + var tabObj = require(name); + + var actions = tabObj.actions; + if (actions) { + $.each(actions, function(actionName, action) { + SunstoneCfg["actions"][actionName] = action; + }); + } + }; + var _addActions = function() { $.each(Config.allTabs(), function(i, tabName){ - var name = "./tabs/" + tabName; - if (DefaultTabsArr.indexOf(tabName) == -1){ - name = "./addons/tabs/" + tabName; - } - var tabObj = require(name); - - var actions = tabObj.actions; - if (actions) { - $.each(actions, function(actionName, action) { - SunstoneCfg["actions"][actionName] = action; - }); - } + _addAction(i, tabName); }); }; @@ -184,34 +188,26 @@ define(function(require) { }); } } + var support_tab = "support-tab"; if(SunstoneCfg && SunstoneCfg.tabs && - config && - config.user_config && - config.user_config.default_view && - config.user_config.default_view === "admin" + !SunstoneCfg.tabs[support_tab] ){ - var support_tab = "support-tab"; - if(!SunstoneCfg.tabs[support_tab]){ - SunstoneCfg.tabs[support_tab] = { - actions: { - "Support.create_dialog": true, - "Support.refresh": true - }, - panels_tabs:{ - "support_info_tab": true - }, - table_columns: [1,2,3,4] - }; - _addMainTab(support_tab); - _insertTab(support_tab); - _setupDataTable(support_tab); - } + SunstoneCfg.tabs[support_tab] = { + actions: { + "Support.create_dialog": true, + "Support.refresh": true + }, + panels_tabs:{ + "support_info_tab": true + }, + table_columns: [1,2,3,4] + }; + _addMainTab(support_tab); + _insertTab(support_tab); + _setupDataTable(support_tab); } _setupTabs(); - $().on("click",function(){ - - }) }; var _setupDataTable = function(tabName) { @@ -258,6 +254,16 @@ define(function(require) { } else { liItem = "