mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1066558 - Cant collapse a tree in web IDE, after expanding it; r=bgrins
This commit is contained in:
parent
d46128c9fc
commit
27f203cfc2
@ -69,14 +69,12 @@ var ResourceContainer = Class({
|
||||
this.elt.appendChild(this.children);
|
||||
|
||||
this.line.addEventListener("click", (evt) => {
|
||||
if (!this.selected) {
|
||||
this.select();
|
||||
this.expanded = true;
|
||||
this.toggleExpansion();
|
||||
evt.stopPropagation();
|
||||
}
|
||||
}, false);
|
||||
this.expander.addEventListener("click", (evt) => {
|
||||
this.expanded = !this.expanded;
|
||||
this.toggleExpansion();
|
||||
this.select();
|
||||
evt.stopPropagation();
|
||||
}, true);
|
||||
@ -87,6 +85,14 @@ var ResourceContainer = Class({
|
||||
this.update();
|
||||
},
|
||||
|
||||
toggleExpansion: function() {
|
||||
if (!this.resource.isRoot) {
|
||||
this.expanded = !this.expanded;
|
||||
} else {
|
||||
this.expanded = true;
|
||||
}
|
||||
},
|
||||
|
||||
destroy: function() {
|
||||
this.elt.remove();
|
||||
this.expander.remove();
|
||||
|
@ -39,10 +39,16 @@ function selectFileFirstLoad(projecteditor, resource) {
|
||||
|
||||
if (resource.isRoot) {
|
||||
ok (container.expanded, "The root directory is expanded by default.");
|
||||
container.line.click();
|
||||
ok (container.expanded, "Clicking on the line does not toggles expansion.");
|
||||
return;
|
||||
}
|
||||
if (resource.isDir) {
|
||||
ok (!container.expanded, "A directory is not expanded by default.");
|
||||
container.line.click();
|
||||
ok (container.expanded, "Clicking on the line toggles expansion.");
|
||||
container.line.click();
|
||||
ok (!container.expanded, "Clicking on the line toggles expansion.");
|
||||
return;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user