Change .style.display to showElem and hideElem

This commit is contained in:
charles 2024-07-19 10:49:07 +08:00
parent 3cf7472410
commit 6d29c32bd3

View File

@ -110,12 +110,14 @@ export function initRepoEditor() {
warningDiv = document.createElement('div');
warningDiv.classList.add('ui', 'warning', 'message', 'flash-message', 'flash-warning');
warningDiv.innerHTML = '<p>Parent directory contains leading or trailing whitespace.</p><p>These whitespaces will be removed.</p>';
// Add display 'block' because display is set to 'none' in formantic\build\semantic.css
warningDiv.style.display = 'block';
const inputContainer = document.querySelector('.repo-editor-header');
inputContainer.insertAdjacentElement('beforebegin', warningDiv);
}
warningDiv.style.display = 'block';
showElem(warningDiv);
} else if (warningDiv) {
warningDiv.style.display = 'none';
hideElem(warningDiv);
}
}
joinTreePath();