diff --git a/static/js/mainMenu.js b/static/js/mainMenu.js index 69e48c8..d31625c 100644 --- a/static/js/mainMenu.js +++ b/static/js/mainMenu.js @@ -590,6 +590,7 @@ oml.ui.mainMenu = function() { oml.UI.set({showSidebar: !ui.showSidebar}); } }); + setTimeout(oml.updateDebugMenu); function getEditMenu() { var listData = oml.getListData(), diff --git a/static/js/preferencesDialog.js b/static/js/preferencesDialog.js index b5d2dfe..4e41f8c 100644 --- a/static/js/preferencesDialog.js +++ b/static/js/preferencesDialog.js @@ -439,6 +439,10 @@ oml.ui.preferencesDialog = function() { if (key == 'theme') { Ox.Theme(value); } + if (key == 'showDebugMenu') { + oml.UI.set({'showDebugMenu': value}); + oml.updateDebugMenu(); + } } }); diff --git a/static/js/utils.js b/static/js/utils.js index a30f9c7..1834afd 100644 --- a/static/js/utils.js +++ b/static/js/utils.js @@ -993,3 +993,9 @@ oml.validatePublicKey = function(value) { return /^[A-Za-z0-9+\/]{43}$/.test(value); }; +oml.updateDebugMenu = function() { + var menu = $('.OxTitle').filter(function(i, e) { + return e.innerHTML == 'Debug' + }); + oml.user.ui.showDebugMenu ? menu.show() : menu.hide(); +};