Skip to content
This repository was archived by the owner on Sep 6, 2021. It is now read-only.

Commit bf2ddaf

Browse files
committed
Merge pull request #9548 from adobe/tom/fix-issue-9363
Fix #9363: Code hints popup dismisses prematurely
2 parents 01ca26c + 6a07e87 commit bf2ddaf

4 files changed

Lines changed: 24 additions & 34 deletions

File tree

src/htmlContent/search-results.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@
44
<tr class="file-section" data-file-index="{{fileIndex}}">
55
{{#replace}}<td class="checkbox-column"><input type="checkbox" class="check-one-file" {{#isChecked}}checked="true"{{/isChecked}} /></td>{{/replace}}
66
<td colspan="2">
7-
<span class="disclosure-triangle expanded" title="{{Strings.FIND_IN_FILES_EXPAND_COLLAPSE}}"></span>
7+
<span class="disclosure-triangle {{^isCollapsed}}expanded{{/isCollapsed}}" title="{{Strings.FIND_IN_FILES_EXPAND_COLLAPSE}}"></span>
88
{{{filename}}}
99
</td>
1010
</tr>
1111
{{#items}}
12-
<tr data-file-index="{{fileIndex}}" data-item-index="{{itemIndex}}" data-match-index="{{matchIndex}}">
12+
<tr data-file-index="{{fileIndex}}" data-item-index="{{itemIndex}}" data-match-index="{{matchIndex}}" {{#isCollapsed}}style="display:none;"{{/isCollapsed}}>
1313
{{#replace}}<td class="checkbox-column"><input type="checkbox" class="check-one" {{#isChecked}}checked="true"{{/isChecked}} /></td>{{/replace}}
1414
<td class="line-number">{{line}}</td>
1515
<td class="line-text">{{pre}}<span class="highlight">{{highlight}}</span>{{post}}</td>

src/language/CodeInspection.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -601,7 +601,7 @@ define(function (require, exports, module) {
601601
$selectedRow.nextUntil(".inspector-section").toggle();
602602

603603
var $triangle = $(".disclosure-triangle", $selectedRow);
604-
$triangle.toggleClass("expanded").toggleClass("collapsed");
604+
$triangle.toggleClass("expanded");
605605
} else {
606606
// This is a problem marker row, show the result on click
607607
// Grab the required position data

src/search/SearchResultsView.js

Lines changed: 20 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ define(function (require, exports, module) {
212212
if (searchItem.collapsed !== collapsed) {
213213
searchItem.collapsed = collapsed;
214214
$(this).nextUntil(".file-section").toggle();
215-
$(this).find(".disclosure-triangle").toggleClass("expanded").toggleClass("collapsed");
215+
$(this).find(".disclosure-triangle").toggleClass("expanded");
216216
}
217217
});
218218

@@ -385,7 +385,7 @@ define(function (require, exports, module) {
385385
self = this;
386386

387387
this._showSummary();
388-
this._searchList = [];
388+
this._searchList = [];
389389

390390
// Iterates throuh the files to display the results sorted by filenamess. The loop ends as soon as
391391
// we filled the results for one page
@@ -427,16 +427,17 @@ define(function (require, exports, module) {
427427
multiLine = match.start.line !== match.end.line;
428428

429429
searchItems.push({
430-
fileIndex: self._searchList.length,
431-
itemIndex: searchItems.length,
432-
matchIndex: i,
433-
line: match.start.line + 1,
434-
pre: match.line.substr(0, match.start.ch),
435-
highlight: match.line.substring(match.start.ch, multiLine ? undefined : match.end.ch),
436-
post: multiLine ? "\u2026" : match.line.substr(match.end.ch),
437-
start: match.start,
438-
end: match.end,
439-
isChecked: match.isChecked
430+
fileIndex: self._searchList.length,
431+
itemIndex: searchItems.length,
432+
matchIndex: i,
433+
line: match.start.line + 1,
434+
pre: match.line.substr(0, match.start.ch),
435+
highlight: match.line.substring(match.start.ch, multiLine ? undefined : match.end.ch),
436+
post: multiLine ? "\u2026" : match.line.substr(match.end.ch),
437+
start: match.start,
438+
end: match.end,
439+
isChecked: match.isChecked,
440+
isCollapsed: item.collapsed
440441
});
441442
if (!match.isChecked) {
442443
allInFileChecked = false;
@@ -456,11 +457,12 @@ define(function (require, exports, module) {
456457
);
457458

458459
self._searchList.push({
459-
fileIndex: self._searchList.length,
460-
filename: displayFileName,
461-
fullPath: fullPath,
462-
isChecked: allInFileChecked,
463-
items: searchItems
460+
fileIndex: self._searchList.length,
461+
filename: displayFileName,
462+
fullPath: fullPath,
463+
isChecked: allInFileChecked,
464+
items: searchItems,
465+
isCollapsed: item.collapsed
464466
});
465467
}
466468
});
@@ -473,16 +475,7 @@ define(function (require, exports, module) {
473475
replace: this._model.isReplace,
474476
searchList: this._searchList,
475477
Strings: Strings
476-
}))
477-
// Restore the collapsed files
478-
.find(".file-section").each(function () {
479-
var fullPath = self._searchList[$(this).data("file-index")].fullPath;
480-
481-
if (self._model.results[fullPath].collapsed) {
482-
self._model.results[fullPath].collapsed = false;
483-
$(this).trigger("click");
484-
}
485-
});
478+
}));
486479

487480
if (this._$selectedRow) {
488481
this._$selectedRow.removeClass("selected");

src/styles/brackets.less

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1344,15 +1344,12 @@ a, img {
13441344
#problems-panel .disclosure-triangle {
13451345
.jstree-sprite;
13461346
display: inline-block;
1347+
background-position: 7px 5px;
13471348
&.expanded {
13481349
// Unfortunately, the way jsTree sprites are aligned within their 18px boxes doesn't look good in
13491350
// other contexts, so we need some tweaks here instead of straight multiples of @jstree-sprite-size
1350-
background-position: 7px 5px;
13511351
-webkit-transform: translateZ(0) rotate(90deg);
13521352
}
1353-
&.collapsed {
1354-
background-position: 7px 5px;
1355-
}
13561353
}
13571354

13581355
/* Modal bar for Find/Quick Open */

0 commit comments

Comments
 (0)