Skip to content

Commit

Permalink
Workaround: manually update already opened context menu on startup
Browse files Browse the repository at this point in the history
(related to #17)
  • Loading branch information
Infocatcher committed Oct 23, 2013
1 parent a5beff5 commit b3239bb
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions CB_Orion_Editor/cbOrionEditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,21 @@ if(!watcher) {
document.loadOverlay("chrome://global/content/editMenuOverlay.xul", null);
window.setTimeout(function() {
document.loadOverlay("chrome://browser/content/devtools/source-editor-overlay.xul", null);
window.setTimeout(function() {
var mp = document.getElementById("sourceEditorContext");
if(mp.state == "closed")
return;
Array.forEach(
mp.getElementsByAttribute("command", "*"),
function(mi) {
var cmd = mi.getAttribute("command");
var controller = document.commandDispatcher
.getControllerForCommand(cmd);
if(controller && !controller.isCommandEnabled(cmd))
mi.setAttribute("disabled", "true");
}
);
}, 60);
if(isCodeMirror) window.setTimeout(function() {
// See view-source:chrome://browser/content/devtools/scratchpad.xul in Firefox 27.0a1
window.goUpdateSourceEditorMenuItems = function() {
Expand Down

0 comments on commit b3239bb

Please sign in to comment.