fix: guard null selectors in showEditForm when button type varies
This commit is contained in:
parent
2e60e19877
commit
60e05cd8fe
1 changed files with 4 additions and 2 deletions
|
|
@ -183,8 +183,10 @@ function reloadDnsmasq() {
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
|
|
||||||
function showEditForm(cell) {
|
function showEditForm(cell) {
|
||||||
cell.querySelector('.edit-btn').style.display = 'none';
|
var editBtn = cell.querySelector('.edit-btn');
|
||||||
cell.querySelector('.pin-needs-name').style.display = 'none';
|
var pinBtn = cell.querySelector('.pin-needs-name');
|
||||||
|
if (editBtn) editBtn.style.display = 'none';
|
||||||
|
if (pinBtn) pinBtn.style.display = 'none';
|
||||||
cell.querySelector('.edit-form').style.display = 'inline-flex';
|
cell.querySelector('.edit-form').style.display = 'inline-flex';
|
||||||
var input = cell.querySelector('.edit-hostname');
|
var input = cell.querySelector('.edit-hostname');
|
||||||
input.focus();
|
input.focus();
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue