From 63271d8e7333e9590d2c935e9b1cd31c9888beae Mon Sep 17 00:00:00 2001 From: TomMalbran Date: Mon, 13 Oct 2014 23:07:35 -0300 Subject: [PATCH 1/3] Move the restore collapsed files logic to the template --- src/htmlContent/search-results.html | 4 +-- src/search/SearchResultsView.js | 45 ++++++++++++----------------- 2 files changed, 21 insertions(+), 28 deletions(-) diff --git a/src/htmlContent/search-results.html b/src/htmlContent/search-results.html index a335cabbcbb..db1ed32750b 100644 --- a/src/htmlContent/search-results.html +++ b/src/htmlContent/search-results.html @@ -4,12 +4,12 @@ {{#replace}}{{/replace}} - + {{{filename}}} {{#items}} - + {{#replace}}{{/replace}} {{line}} {{pre}}{{highlight}}{{post}} diff --git a/src/search/SearchResultsView.js b/src/search/SearchResultsView.js index c938a5be67e..b3005a6a878 100644 --- a/src/search/SearchResultsView.js +++ b/src/search/SearchResultsView.js @@ -385,7 +385,7 @@ define(function (require, exports, module) { self = this; this._showSummary(); - this._searchList = []; + this._searchList = []; // Iterates throuh the files to display the results sorted by filenamess. The loop ends as soon as // we filled the results for one page @@ -427,16 +427,17 @@ define(function (require, exports, module) { multiLine = match.start.line !== match.end.line; searchItems.push({ - fileIndex: self._searchList.length, - itemIndex: searchItems.length, - matchIndex: i, - line: match.start.line + 1, - pre: match.line.substr(0, match.start.ch), - highlight: match.line.substring(match.start.ch, multiLine ? undefined : match.end.ch), - post: multiLine ? "\u2026" : match.line.substr(match.end.ch), - start: match.start, - end: match.end, - isChecked: match.isChecked + fileIndex: self._searchList.length, + itemIndex: searchItems.length, + matchIndex: i, + line: match.start.line + 1, + pre: match.line.substr(0, match.start.ch), + highlight: match.line.substring(match.start.ch, multiLine ? undefined : match.end.ch), + post: multiLine ? "\u2026" : match.line.substr(match.end.ch), + start: match.start, + end: match.end, + isChecked: match.isChecked, + isCollapsed: item.collapsed }); if (!match.isChecked) { allInFileChecked = false; @@ -456,11 +457,12 @@ define(function (require, exports, module) { ); self._searchList.push({ - fileIndex: self._searchList.length, - filename: displayFileName, - fullPath: fullPath, - isChecked: allInFileChecked, - items: searchItems + fileIndex: self._searchList.length, + filename: displayFileName, + fullPath: fullPath, + isChecked: allInFileChecked, + items: searchItems, + isCollapsed: item.collapsed }); } }); @@ -473,16 +475,7 @@ define(function (require, exports, module) { replace: this._model.isReplace, searchList: this._searchList, Strings: Strings - })) - // Restore the collapsed files - .find(".file-section").each(function () { - var fullPath = self._searchList[$(this).data("file-index")].fullPath; - - if (self._model.results[fullPath].collapsed) { - self._model.results[fullPath].collapsed = false; - $(this).trigger("click"); - } - }); + })); if (this._$selectedRow) { this._$selectedRow.removeClass("selected"); From 397d747842824c22aceb3e6d2287cf6fa6321c0f Mon Sep 17 00:00:00 2001 From: TomMalbran Date: Sun, 19 Oct 2014 19:54:08 -0300 Subject: [PATCH 2/3] Remove the collapsed class --- src/extensions/default/DarkTheme/main.less | 2 +- src/htmlContent/search-results.html | 2 +- src/language/CodeInspection.js | 2 +- src/search/SearchResultsView.js | 2 +- src/styles/brackets.less | 5 +---- 5 files changed, 5 insertions(+), 8 deletions(-) diff --git a/src/extensions/default/DarkTheme/main.less b/src/extensions/default/DarkTheme/main.less index b40225671e1..3c1d185f2f4 100644 --- a/src/extensions/default/DarkTheme/main.less +++ b/src/extensions/default/DarkTheme/main.less @@ -160,7 +160,7 @@ /* Non-editor styling */ .image-view, -.not-editor { +.not-editor.not-editor { background-color: @background; } diff --git a/src/htmlContent/search-results.html b/src/htmlContent/search-results.html index db1ed32750b..8783581a730 100644 --- a/src/htmlContent/search-results.html +++ b/src/htmlContent/search-results.html @@ -4,7 +4,7 @@ {{#replace}}{{/replace}} - + {{{filename}}} diff --git a/src/language/CodeInspection.js b/src/language/CodeInspection.js index cb6f98473c8..7ac53507cac 100644 --- a/src/language/CodeInspection.js +++ b/src/language/CodeInspection.js @@ -601,7 +601,7 @@ define(function (require, exports, module) { $selectedRow.nextUntil(".inspector-section").toggle(); var $triangle = $(".disclosure-triangle", $selectedRow); - $triangle.toggleClass("expanded").toggleClass("collapsed"); + $triangle.toggleClass("expanded"); } else { // This is a problem marker row, show the result on click // Grab the required position data diff --git a/src/search/SearchResultsView.js b/src/search/SearchResultsView.js index b3005a6a878..c0bf29bb045 100644 --- a/src/search/SearchResultsView.js +++ b/src/search/SearchResultsView.js @@ -212,7 +212,7 @@ define(function (require, exports, module) { if (searchItem.collapsed !== collapsed) { searchItem.collapsed = collapsed; $(this).nextUntil(".file-section").toggle(); - $(this).find(".disclosure-triangle").toggleClass("expanded").toggleClass("collapsed"); + $(this).find(".disclosure-triangle").toggleClass("expanded"); } }); diff --git a/src/styles/brackets.less b/src/styles/brackets.less index 5e2a1f962a7..8bb786c9431 100644 --- a/src/styles/brackets.less +++ b/src/styles/brackets.less @@ -1327,15 +1327,12 @@ a, img { #problems-panel .disclosure-triangle { .jstree-sprite; display: inline-block; + background-position: 7px 5px; &.expanded { // Unfortunately, the way jsTree sprites are aligned within their 18px boxes doesn't look good in // other contexts, so we need some tweaks here instead of straight multiples of @jstree-sprite-size - background-position: 7px 5px; -webkit-transform: translateZ(0) rotate(90deg); } - &.collapsed { - background-position: 7px 5px; - } } /* Modal bar for Find/Quick Open */ From 6a07e87a0b9f2ebe25301296b14b86961f032e0e Mon Sep 17 00:00:00 2001 From: TomMalbran Date: Sun, 19 Oct 2014 21:01:47 -0300 Subject: [PATCH 3/3] Remove unwanted change --- src/extensions/default/DarkTheme/main.less | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/extensions/default/DarkTheme/main.less b/src/extensions/default/DarkTheme/main.less index 3c1d185f2f4..b40225671e1 100644 --- a/src/extensions/default/DarkTheme/main.less +++ b/src/extensions/default/DarkTheme/main.less @@ -160,7 +160,7 @@ /* Non-editor styling */ .image-view, -.not-editor.not-editor { +.not-editor { background-color: @background; }