|
|
|
|
@ -2081,10 +2081,11 @@ HTML = """<!doctype html>
|
|
|
|
|
if (block.dataset.custom === 'true' && !state && !deleted) {
|
|
|
|
|
const remove = document.createElement('button');
|
|
|
|
|
remove.type = 'button';
|
|
|
|
|
remove.textContent = 'удалить';
|
|
|
|
|
remove.textContent = 'удалить навсегда';
|
|
|
|
|
remove.title = 'Удалить блок без возможности восстановления';
|
|
|
|
|
remove.addEventListener('click', event => {
|
|
|
|
|
event.stopPropagation();
|
|
|
|
|
setConfigBlockState(block, 'deleted');
|
|
|
|
|
removeConfigBlockForever(block);
|
|
|
|
|
});
|
|
|
|
|
actions.appendChild(remove);
|
|
|
|
|
}
|
|
|
|
|
@ -2123,6 +2124,17 @@ HTML = """<!doctype html>
|
|
|
|
|
setText('configLayoutState', `${visible} блоков · ${hidden.length} скрыто · ${deleted.length} в корзине`);
|
|
|
|
|
if (configCanvas) applyStoredConfigLayout();
|
|
|
|
|
}
|
|
|
|
|
function removeConfigBlockForever(block) {
|
|
|
|
|
if (!block || block.dataset.custom !== 'true') return;
|
|
|
|
|
if (block.contains(document.activeElement)) document.activeElement.blur();
|
|
|
|
|
const key = block.dataset.section;
|
|
|
|
|
block.remove();
|
|
|
|
|
configBlocks = configBlocks.filter(item => item !== block);
|
|
|
|
|
if (key) delete configLayout[key];
|
|
|
|
|
saveConfigLayout();
|
|
|
|
|
renderConfigRestorePanel();
|
|
|
|
|
setText('configLayoutState', 'блок удалён навсегда');
|
|
|
|
|
}
|
|
|
|
|
function nextCustomConfigKey() {
|
|
|
|
|
let index = 1;
|
|
|
|
|
while (configBlocks.some(block => block.dataset.section === `custom-${index}`)) index += 1;
|
|
|
|
|
|