From 1174c7ed0880e7bffb187f2bd800bf3a862904fb Mon Sep 17 00:00:00 2001 From: Alex Bardanov Date: Sun, 15 Feb 2015 21:48:51 +0200 Subject: [PATCH] v0.5.11 - show/hide close button option --- package.json | 2 +- services/preferences.js | 3 ++- templates/holder.html | 2 +- templates/modal.html | 18 +++++++----------- viewmodels/documents.js | 4 ++++ viewmodels/generalOptions.js | 6 ++++++ 6 files changed, 21 insertions(+), 14 deletions(-) diff --git a/package.json b/package.json index cc565fb..c580c50 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "title": "Documents Toolbar", "description": "Adds toolbar with tabs of open documents on the top of the editor. Now with split view support!", "homepage": "https://github.com/dnbard/brackets-documents-toolbar", - "version": "0.5.10", + "version": "0.5.11", "author": "Alex Bardanov", "license": "MIT", "engines": { diff --git a/services/preferences.js b/services/preferences.js index eca7c83..56757a9 100644 --- a/services/preferences.js +++ b/services/preferences.js @@ -11,7 +11,8 @@ define(function(require, exports){ close_left: false, workingFiles: true, brackets_font: true, - grayscaleIcons: false + grayscaleIcons: false, + showCloseButton: true }; exports.init = function(){ diff --git a/templates/holder.html b/templates/holder.html index d194021..f09b68d 100644 --- a/templates/holder.html +++ b/templates/holder.html @@ -8,7 +8,7 @@ - + diff --git a/templates/modal.html b/templates/modal.html index c30d12f..8741f15 100644 --- a/templates/modal.html +++ b/templates/modal.html @@ -12,17 +12,13 @@

Documents toolbar settings

Show Working Files panel -
- - Show Icons -
-
- - Small Icons -
-
- - Grayscale Icons +
+ + Show + + close button + on tab + [use middle mouse button to close tabs]
diff --git a/viewmodels/documents.js b/viewmodels/documents.js index b0c49e8..bcbd7a8 100644 --- a/viewmodels/documents.js +++ b/viewmodels/documents.js @@ -39,6 +39,8 @@ define(function(require, exports, module){ self.fontEnabled(value); }); + this.isShowCloseButtonOnTabs = ko.observable(!!prefs.get('showCloseButton')); + this.onDocumentClick = function(model, event){ CommandManager.execute('file.open', { fullPath: model._path @@ -134,6 +136,8 @@ define(function(require, exports, module){ var hoveredDocument = null; this.onDocumentMouseIn = function(document, event){ + self.isShowCloseButtonOnTabs(!!prefs.get('showCloseButton')); + if (!prefs.get('tooltip')){ return; } diff --git a/viewmodels/generalOptions.js b/viewmodels/generalOptions.js index e916477..78e418f 100644 --- a/viewmodels/generalOptions.js +++ b/viewmodels/generalOptions.js @@ -58,11 +58,17 @@ define(function(require, exports, module){ prefs.set('smallIcons', value); }); + this.showCloseButton = ko.observable(); + this.showCloseButton.subscribe(function(value){ + prefs.set('showCloseButton', value); + }); + this.showWorkingFiles(prefs.get('workingFiles')); this.showIcons(prefs.get('icons')); this.useBracketsFont(prefs.get('brackets_font')); this.grayscaleIcons(prefs.get('grayscaleIcons')); this.smallIcons(prefs.get('smallIcons')); + this.showCloseButton(prefs.get('showCloseButton')); } module.exports = GeneralOptions;