зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1839066 - Improve selection checks in places-tree. r=mak
This doesn't fix the bug but I saw some exceptions related to having a non-null view with a null selection that this fixes. Differential Revision: https://phabricator.services.mozilla.com/D181379
This commit is contained in:
Родитель
96a16d3cad
Коммит
65e3a8d175
|
@ -223,8 +223,12 @@
|
|||
return this.getAttribute("place");
|
||||
}
|
||||
|
||||
get selectedCount() {
|
||||
return this.view?.selection?.count || 0;
|
||||
}
|
||||
|
||||
get hasSelection() {
|
||||
return this.view && this.view.selection.count >= 1;
|
||||
return this.selectedCount >= 1;
|
||||
}
|
||||
|
||||
get selectedNodes() {
|
||||
|
@ -308,12 +312,11 @@
|
|||
}
|
||||
|
||||
get selectedNode() {
|
||||
var view = this.view;
|
||||
if (!view || view.selection.count != 1) {
|
||||
if (this.selectedCount != 1) {
|
||||
return null;
|
||||
}
|
||||
|
||||
var selection = view.selection;
|
||||
var selection = this.view.selection;
|
||||
var min = {},
|
||||
max = {};
|
||||
selection.getRangeAt(0, min, max);
|
||||
|
|
Загрузка…
Ссылка в новой задаче