Split admin css from app.css

Cleanup normalize and bootstrap css
Removed almost all css float
Removed CKEditor from app.css
This commit is contained in:
djmaze 2021-02-18 21:06:19 +01:00
parent 6dacfb3cf4
commit b6d8fa5b3f
74 changed files with 455 additions and 1014 deletions

View file

@ -16,6 +16,17 @@
const t = e.target, href = t.href || (t.parentNode && t.parentNode.href);
(href && href.slice(-1) === '#') && e.preventDefault();
},
open = bool => {
menu && menu.classList.toggle('show', bool);
parent.classList.toggle('show', bool);
element.setAttribute('aria-expanded', bool);
element.open = bool;
if (bool) {
element.removeEventListener('click',clickHandler);
} else {
setTimeout(() => element.addEventListener('click',clickHandler), 1);
}
},
toggleEvents = () => {
let action = (element.open ? 'add' : 'remove') + 'EventListener';
doc[action]('click',dismissHandler);
@ -63,28 +74,19 @@
menu = parent.querySelector('.dropdown-menu');
menuItems = [...menu.querySelectorAll('A')].filter(item => 'none' != item.parentNode.style.display);
!('tabindex' in menu) && menu.setAttribute('tabindex', '0');
menu.classList.add('show');
parent.classList.add('show');
element.setAttribute('aria-expanded',true);
element.open = true;
element.removeEventListener('click',clickHandler);
open(true);
setTimeout(() => {
setFocus( menu.getElementsByTagName('INPUT')[0] || element );
toggleEvents();
},1);
};
self.hide = () => {
menu.classList.remove('show');
parent.classList.remove('show');
element.setAttribute('aria-expanded',false);
element.open = false;
open(false);
toggleEvents();
setFocus(element);
setTimeout(() => element.Dropdown && element.addEventListener('click',clickHandler), 1);
};
self.toggle = () => element.open ? self.hide() : self.show();
element.addEventListener('click',clickHandler);
element.open = false;
open(false);
element.Dropdown = self;
},