|
38 | 38 | define(function (require, exports, module) {
|
39 | 39 |
|
40 | 40 |
|
41 |
| - var AppInit = require("utils/AppInit"), |
42 |
| - ProjectManager = require("project/ProjectManager"), |
43 |
| - WorkingSetView = require("project/WorkingSetView"), |
44 |
| - MainViewManager = require("view/MainViewManager"), |
45 |
| - CommandManager = require("command/CommandManager"), |
46 |
| - Commands = require("command/Commands"), |
47 |
| - Strings = require("strings"), |
48 |
| - Resizer = require("utils/Resizer"), |
49 |
| - _ = require("thirdparty/lodash"); |
| 41 | + var AppInit = require("utils/AppInit"), |
| 42 | + ProjectManager = require("project/ProjectManager"), |
| 43 | + PreferencesManager = require("preferences/PreferencesManager"), |
| 44 | + WorkingSetView = require("project/WorkingSetView"), |
| 45 | + MainViewManager = require("view/MainViewManager"), |
| 46 | + CommandManager = require("command/CommandManager"), |
| 47 | + Commands = require("command/Commands"), |
| 48 | + Strings = require("strings"), |
| 49 | + Resizer = require("utils/Resizer"), |
| 50 | + _ = require("thirdparty/lodash"); |
50 | 51 |
|
51 | 52 | // These vars are initialized by the htmlReady handler
|
52 | 53 | // below since they refer to DOM elements
|
@@ -244,6 +245,23 @@ define(function (require, exports, module) {
|
244 | 245 |
|
245 | 246 | // Tooltips
|
246 | 247 | $splitViewMenu.attr("title", Strings.GEAR_MENU_TOOLTIP);
|
| 248 | + |
| 249 | + // Define the preference to decide whether to hide the working set or not |
| 250 | + PreferencesManager.definePreference("hideWorkingSet", "boolean", false, { |
| 251 | + description: Strings.DESCRIPTION_HIDE_WORKING_SET |
| 252 | + }) |
| 253 | + .on("change", function () { |
| 254 | + // 'working-set-list-container' is the id of the main working set element which we need to hide/show |
| 255 | + const $workingSet = $(document.getElementById("working-set-list-container")); |
| 256 | + const getPref = PreferencesManager.get("hideWorkingSet"); |
| 257 | + |
| 258 | + if(getPref) { |
| 259 | + // refer to brackets.less file for styles |
| 260 | + $workingSet.addClass("working-set-hidden"); |
| 261 | + } else { |
| 262 | + $workingSet.removeClass("working-set-hidden"); |
| 263 | + } |
| 264 | + }); |
247 | 265 | });
|
248 | 266 |
|
249 | 267 | ProjectManager.on("projectOpen", _updateProjectTitle);
|
|
0 commit comments