Skip to content

Commit

Permalink
Fixed issues with running focusmode on OSX
Browse files Browse the repository at this point in the history
  • Loading branch information
Naatan committed Jul 15, 2015
1 parent 206fcd5 commit 435e0ea
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
14 changes: 11 additions & 3 deletions content/focusmode.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@

var active = prefs.getBoolean("focusmode_on", false);
var state = JSON.parse(prefs.getString("focusmode_state", "{}"));

var platform = require("sdk/system").platform;
var isOSX = platform == "darwin";

//log.setLevel(require("ko/logging").LOG_DEBUG);

this.register = function()
Expand All @@ -32,6 +34,12 @@
}
]
});

// Work around bug in Komodo <9.2
if ( ! "updateToolboxVisibility" in ko.uilayout)
{
ko.uilayout.updateToolboxVisibility = function() {};
}
}

this.toggle = function()
Expand All @@ -52,7 +60,7 @@
prefs.setBoolean("focusmode_on", true);

if (state.toolbars) ko.commands.doCommand('cmd_toggleToolbars');
if (state.menu) ko.commands.doCommand('cmd_toggleMenubar');
if (state.menu && ! isOSX) ko.commands.doCommand('cmd_toggleMenubar');
ko.uilayout.ensurePaneHidden("workspace_left_area");
ko.uilayout.ensurePaneHidden("workspace_right_area");
ko.uilayout.ensurePaneHidden("workspace_bottom_area");
Expand All @@ -75,7 +83,7 @@
elems.toolbarsBc.setAttribute("checked", "true");
}

if (state.menu && state.menu != _state.menu)
if ( ! isOSX && state.menu && state.menu != _state.menu)
{
ko.commands.doCommand('cmd_toggleMenubar');
elems.menuBc.setAttribute("checked", "true");
Expand Down
2 changes: 1 addition & 1 deletion install.rdf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<Description about="urn:mozilla:install-manifest">
<em:id>[email protected]</em:id>
<em:name>Focus Mode</em:name>
<em:version>1.0.1</em:version>
<em:version>1.0.2</em:version>
<em:description>Adds a toggle that enables/disables all non-essential UI elements</em:description>
<em:creator>Nathan Rijksen</em:creator>
<em:homepageURL>http://www.activestate.com/komodo-ide</em:homepageURL>
Expand Down

0 comments on commit 435e0ea

Please sign in to comment.