зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1060041 - Don't expand folders in projecteditor tree by default;r=jryans
This commit is contained in:
Родитель
d6888a866b
Коммит
de2965fbbf
|
@ -57,6 +57,13 @@ var Resource = Class({
|
|||
*/
|
||||
get hasChildren() { return this.children && this.children.size > 0; },
|
||||
|
||||
/**
|
||||
* Is this Resource the root (top level for the store)?
|
||||
*/
|
||||
get isRoot() {
|
||||
return !this.parent
|
||||
},
|
||||
|
||||
/**
|
||||
* Sorted array of children for display
|
||||
*/
|
||||
|
|
|
@ -84,6 +84,9 @@ var ResourceContainer = Class({
|
|||
evt.stopPropagation();
|
||||
}, true);
|
||||
|
||||
if (!this.resource.isRoot) {
|
||||
this.expanded = false;
|
||||
}
|
||||
this.update();
|
||||
},
|
||||
|
||||
|
|
|
@ -35,8 +35,14 @@ let test = asyncTest(function*() {
|
|||
function selectFileFirstLoad(projecteditor, resource) {
|
||||
ok (resource && resource.path, "A valid resource has been passed in for selection " + (resource && resource.path));
|
||||
projecteditor.projectTree.selectResource(resource);
|
||||
let container = projecteditor.projectTree.getViewContainer(resource);
|
||||
|
||||
if (resource.isRoot) {
|
||||
ok (container.expanded, "The root directory is expanded by default.");
|
||||
return;
|
||||
}
|
||||
if (resource.isDir) {
|
||||
ok (!container.expanded, "A directory is not expanded by default.");
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче