made deleteHandler and updateDeleteButton private
This commit is contained in:
parent
976dd35810
commit
496257e3ce
2 changed files with 6 additions and 6 deletions
|
@ -990,7 +990,7 @@ Logic.registerPanel(P_CONTAINERS_EDIT, {
|
||||||
/* This function is the handler of deletion for both keypress delete and delete button.
|
/* This function is the handler of deletion for both keypress delete and delete button.
|
||||||
The keypress delete support for both backspace and delete key.
|
The keypress delete support for both backspace and delete key.
|
||||||
*/
|
*/
|
||||||
async deleteHandler() {
|
async _deleteHandler() {
|
||||||
const selectedIdentities = Logic.currentSelectedIdentities();
|
const selectedIdentities = Logic.currentSelectedIdentities();
|
||||||
if (selectedIdentities.length > 0) {
|
if (selectedIdentities.length > 0) {
|
||||||
await Logic.showPanel(P_CONTAINER_DELETE);
|
await Logic.showPanel(P_CONTAINER_DELETE);
|
||||||
|
@ -1000,7 +1000,7 @@ Logic.registerPanel(P_CONTAINERS_EDIT, {
|
||||||
/* The function is to update the delete button.
|
/* The function is to update the delete button.
|
||||||
The delete button shows up once any containers are selected.
|
The delete button shows up once any containers are selected.
|
||||||
*/
|
*/
|
||||||
updateDeleteButton(selectedContainers) {
|
_updateDeleteButton(selectedContainers) {
|
||||||
const deleteButton = document.querySelector("div.panel-footer.panel-footer-secondary");
|
const deleteButton = document.querySelector("div.panel-footer.panel-footer-secondary");
|
||||||
if (selectedContainers.length === 0) {
|
if (selectedContainers.length === 0) {
|
||||||
deleteButton.classList.add("hide");
|
deleteButton.classList.add("hide");
|
||||||
|
@ -1015,13 +1015,13 @@ Logic.registerPanel(P_CONTAINERS_EDIT, {
|
||||||
Logic.showPanel(P_CONTAINERS_LIST);
|
Logic.showPanel(P_CONTAINERS_LIST);
|
||||||
});
|
});
|
||||||
|
|
||||||
Logic.addEnterHandler(document.querySelector("#delete-link"), this.deleteHandler);
|
Logic.addEnterHandler(document.querySelector("#delete-link"), this._deleteHandler);
|
||||||
|
|
||||||
document.addEventListener("keydown", e => {
|
document.addEventListener("keydown", e => {
|
||||||
if (e.keyCode === 16) {
|
if (e.keyCode === 16) {
|
||||||
this.shiftOn = true;
|
this.shiftOn = true;
|
||||||
} else if (e.keyCode === 8 || e.keyCode === 48) {
|
} else if (e.keyCode === 8 || e.keyCode === 48) {
|
||||||
this.deleteHandler();
|
this._deleteHandler();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -1035,7 +1035,7 @@ Logic.registerPanel(P_CONTAINERS_EDIT, {
|
||||||
// This method is called when the panel is shown.
|
// This method is called when the panel is shown.
|
||||||
prepare() {
|
prepare() {
|
||||||
Logic.resetSelectedIdentities();
|
Logic.resetSelectedIdentities();
|
||||||
this.updateDeleteButton(Logic.currentSelectedIdentities());
|
this._updateDeleteButton(Logic.currentSelectedIdentities());
|
||||||
const fragment = document.createDocumentFragment();
|
const fragment = document.createDocumentFragment();
|
||||||
Logic.identities().forEach(identity => {
|
Logic.identities().forEach(identity => {
|
||||||
const tr = document.createElement("tr");
|
const tr = document.createElement("tr");
|
||||||
|
@ -1107,7 +1107,7 @@ Logic.registerPanel(P_CONTAINERS_EDIT, {
|
||||||
}
|
}
|
||||||
|
|
||||||
this.lastSelected = identity;
|
this.lastSelected = identity;
|
||||||
this.updateDeleteButton(currentSelectedIdentity);
|
this._updateDeleteButton(currentSelectedIdentity);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
0
test/issues/1624.test.js
Normal file
0
test/issues/1624.test.js
Normal file
Loading…
Add table
Reference in a new issue