mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-11 12:25:53 +00:00
Bug 1328008 - Stop collapsing TreeView nodes when clicking a value. r=Honza
This commit is contained in:
parent
8dfeaddc82
commit
a1f7ac5069
@ -14,20 +14,25 @@ add_task(function* () {
|
||||
|
||||
ok(tab.linkedBrowser.contentPrincipal.isNullPrincipal, "Should have null principal");
|
||||
|
||||
let countBefore = yield getElementCount(".jsonPanelBox .treeTable .treeRow");
|
||||
ok(countBefore == 3, "There must be three rows");
|
||||
is(yield countRows(), 3, "There must be three rows");
|
||||
|
||||
let objectCellCount = yield getElementCount(
|
||||
".jsonPanelBox .treeTable .objectCell");
|
||||
ok(objectCellCount == 1, "There must be one object cell");
|
||||
is(objectCellCount, 1, "There must be one object cell");
|
||||
|
||||
let objectCellText = yield getElementText(
|
||||
".jsonPanelBox .treeTable .objectCell");
|
||||
ok(objectCellText == "", "The summary is hidden when object is expanded");
|
||||
is(objectCellText, "", "The summary is hidden when object is expanded");
|
||||
|
||||
// Collapsed auto-expanded node.
|
||||
// Clicking the value does not collapse it (so that it can be selected and copied).
|
||||
yield clickJsonNode(".jsonPanelBox .treeTable .treeValueCell");
|
||||
is(yield countRows(), 3, "There must still be three rows");
|
||||
|
||||
// Clicking the label collapses the auto-expanded node.
|
||||
yield clickJsonNode(".jsonPanelBox .treeTable .treeLabel");
|
||||
|
||||
let countAfter = yield getElementCount(".jsonPanelBox .treeTable .treeRow");
|
||||
ok(countAfter == 1, "There must be one row");
|
||||
is(yield countRows(), 1, "There must be one row");
|
||||
});
|
||||
|
||||
function countRows() {
|
||||
return getElementCount(".jsonPanelBox .treeTable .treeRow");
|
||||
}
|
||||
|
@ -213,7 +213,10 @@ define(function (require, exports, module) {
|
||||
|
||||
onClickRow: function (nodePath, event) {
|
||||
event.stopPropagation();
|
||||
let cell = event.target.closest("td");
|
||||
if (cell && cell.classList.contains("treeLabelCell")) {
|
||||
this.toggle(nodePath);
|
||||
}
|
||||
this.selectRow(nodePath);
|
||||
},
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user