mirror of
https://github.com/potato47/ccc-devtools.git
synced 2024-12-24 10:49:02 +00:00
fix:适配3.6.2,修复键盘事件失效问题
This commit is contained in:
parent
9a232daab8
commit
44836565c0
Binary file not shown.
@ -50,26 +50,26 @@
|
||||
</html>
|
||||
|
||||
<script>
|
||||
// document.getElementsByClassName('toolbar')[0].insertAdjacentHTML('afterbegin', '<div><button id="btn-show-tree">Tree</button></div>');
|
||||
// const devtoolsBtn = document.getElementById('btn-show-tree');
|
||||
// let isOpen = !!localStorage.getItem('ccc_devtools_show');
|
||||
// toggle(isOpen);
|
||||
// devtoolsBtn.addEventListener('click', () => {
|
||||
// isOpen = !isOpen;
|
||||
// toggle(isOpen);
|
||||
// }, false);
|
||||
document.getElementsByClassName('toolbar')[0].insertAdjacentHTML('afterbegin', '<div><button id="btn-show-tree">Tree</button></div>');
|
||||
const devtoolsBtn = document.getElementById('btn-show-tree');
|
||||
let isOpen = !!localStorage.getItem('ccc_devtools_show');
|
||||
toggle(isOpen);
|
||||
devtoolsBtn.addEventListener('click', () => {
|
||||
isOpen = !isOpen;
|
||||
toggle(isOpen);
|
||||
}, false);
|
||||
|
||||
// function toggle(isOpen) {
|
||||
// const devApp = document.getElementById('dev-app');
|
||||
// window.ccdevShow = isOpen;
|
||||
// if (isOpen) {
|
||||
// devApp.style.display = 'flex';
|
||||
// devtoolsBtn.classList.add('checked');
|
||||
// localStorage.setItem('ccc_devtools_show', 1);
|
||||
// } else {
|
||||
// devApp.style.display = 'none';
|
||||
// devtoolsBtn.classList.remove('checked');
|
||||
// localStorage.removeItem('ccc_devtools_show');
|
||||
// }
|
||||
// }
|
||||
function toggle(isOpen) {
|
||||
const devApp = document.getElementById('dev-app');
|
||||
window.ccdevShow = isOpen;
|
||||
if (isOpen) {
|
||||
devApp.style.display = 'flex';
|
||||
devtoolsBtn.classList.add('checked');
|
||||
localStorage.setItem('ccc_devtools_show', 1);
|
||||
} else {
|
||||
devApp.style.display = 'none';
|
||||
devtoolsBtn.classList.remove('checked');
|
||||
localStorage.removeItem('ccc_devtools_show');
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
Loading…
Reference in New Issue
Block a user