diff --git a/erpnext/home/page/event_updates/event_updates.js b/erpnext/home/page/event_updates/event_updates.js index 6d60418e9c..6e09cca971 100644 --- a/erpnext/home/page/event_updates/event_updates.js +++ b/erpnext/home/page/event_updates/event_updates.js @@ -632,7 +632,7 @@ pscript.complete_registration = function(is_complete) { var d = new Dialog(400, 200, "Please Complete Your Registration"); if(user != 'Administrator'){ d.no_cancel(); // Hide close image - $dh(page_body.wntoolbar.wrapper); + $('header').toggle(false); } d.make_body([ @@ -672,7 +672,7 @@ pscript.complete_registration = function(is_complete) { $c_obj('Setup Control','setup_account',JSON.stringify(args),function(r, rt){ sys_defaults = r.message; d.hide(); - $ds(page_body.wntoolbar.wrapper); + $('header').toggle(true); }); } } diff --git a/erpnext/startup/startup.js b/erpnext/startup/startup.js index d46d49ec9e..ad4e78ec4d 100644 --- a/erpnext/startup/startup.js +++ b/erpnext/startup/startup.js @@ -10,28 +10,18 @@ var user_full_nm = {}; // check if session user is system manager if(inList(user_roles,'System Manager')) is_system_manager = 1; +wn.require('erpnext/startup/toolbar.js'); + function startup_setup() { pscript.is_erpnext_saas = cint(locals['Control Panel']['Control Panel'].sync_with_gateway) if(get_url_arg('embed')) { // hide header, footer - $dh(page_body.banner_area); - $dh(page_body.wntoolbar); + $('.topbar').css('display', 'none'); $dh(page_body.footer); return; } - // page structure - // -------------- - if(page_body.wntoolbar) { - $td(page_body.wntoolbar.body_tab,0,0).innerHTML = 'erpnext'; - $y($td(page_body.wntoolbar.body_tab,0,0), { - width:'140px', - color:'#FFF', - paddingLeft:'8px', - paddingRight:'8px', - fontSize:'14px' - }); - } + $dh(page_body.banner_area); // sidebar @@ -43,7 +33,7 @@ function startup_setup() { page_body.footer.innerHTML = '
'; // setup toolbar - pscript.startup_setup_toolbar(); + erpnext.toolbar.setup(); } // ==================================================================== @@ -418,37 +408,6 @@ pscript.startup_set_module_order = function() { $c_obj('Home Control', 'get_module_order', '', callback) } - -// ==================================================================== - -pscript.startup_setup_toolbar = function() { - var menu_tab = page_body.wntoolbar.menu_table_right; - // help - // ---- - $td(menu_tab,0,0).innerHTML = 'Help'; - - $td(menu_tab,0,1).innerHTML = 'Forum'; - - if(pscript.is_erpnext_saas){ - // Live Chat Help - // -------------- - $td(menu_tab,0,2).innerHTML = 'Chat'; - - // Manage account - // -------------- - if(is_system_manager) { - $td(menu_tab,0,3).innerHTML = 'Billing'; - } - } - else{ - $dh($td(menu_tab,0,2)); - $dh($td(menu_tab,0,3)); - } - - $y(cell, page_body.wntoolbar.right_table_style); - -} - // chart of accounts // ==================================================================== show_chart_browser = function(nm, chart_type){ diff --git a/erpnext/startup/toolbar.js b/erpnext/startup/toolbar.js new file mode 100644 index 0000000000..49738ce1ee --- /dev/null +++ b/erpnext/startup/toolbar.js @@ -0,0 +1,27 @@ +/* toolbar settings */ +wn.provide('erpnext.toolbar'); + +erpnext.toolbar.setup = function() { + // profile + $('#toolbar-user').append('