DJANGO Phase 1
This commit is contained in:
@@ -0,0 +1,70 @@
|
||||
.admin-interface.foldable-apps [class^="app-"].module {
|
||||
visibility: hidden;
|
||||
}
|
||||
|
||||
.admin-interface.foldable-apps [class^="app-"].module.foldable-apps-ready {
|
||||
visibility: visible;
|
||||
}
|
||||
|
||||
.admin-interface.foldable-apps [class^="app-"].module > table > caption {
|
||||
position: relative;
|
||||
z-index: 0;
|
||||
/* pointer-events: none; */
|
||||
cursor: pointer;
|
||||
-webkit-touch-callout: none; /* iOS Safari */
|
||||
-webkit-user-select: none; /* Safari */
|
||||
-khtml-user-select: none; /* Konqueror HTML */
|
||||
-moz-user-select: none; /* Firefox */
|
||||
-ms-user-select: none; /* Internet Explorer/Edge */
|
||||
user-select: none; /* Non-prefixed version, currently supported by Chrome and Opera */
|
||||
}
|
||||
|
||||
.admin-interface.foldable-apps [class^="app-"].module > table > caption > a {
|
||||
display: inline-block;
|
||||
/* pointer-events: all !important; */
|
||||
margin-right: 30px;
|
||||
}
|
||||
|
||||
.admin-interface.foldable-apps [class^="app-"].module > table > caption::after {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
z-index: 10;
|
||||
width: auto;
|
||||
height: 100%;
|
||||
content: "−";
|
||||
font-size: 16px;
|
||||
font-weight: lighter;
|
||||
text-align: center;
|
||||
padding-left: 10px;
|
||||
padding-right: 10px;
|
||||
cursor: pointer;
|
||||
pointer-events: all !important;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
@media (min-width: 1024px) {
|
||||
.admin-interface.foldable-apps [class^="app-"].module > table > caption::after {
|
||||
padding-left: 15px;
|
||||
padding-right: 15px;
|
||||
}
|
||||
}
|
||||
|
||||
.admin-interface.foldable-apps [class^="app-"].module > table {
|
||||
display: table;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.admin-interface.foldable-apps [class^="app-"].module.collapsed {
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.admin-interface.foldable-apps [class^="app-"].module.collapsed > table > caption::after {
|
||||
content: "+";
|
||||
}
|
||||
|
||||
.admin-interface.foldable-apps [class^="app-"].module.collapsed > table > tbody {
|
||||
display: none;
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
(function() {
|
||||
window.onload = function() {
|
||||
for (let moduleEl of document.querySelectorAll('.admin-interface.foldable-apps [class^="app-"].module')) {
|
||||
// apply collapsed value from localstorage value
|
||||
let moduleAppClass = null;
|
||||
let moduleCollapsedClass = 'collapsed';
|
||||
moduleEl.classList.forEach(function(className) {
|
||||
if (className.startsWith('app-')) {
|
||||
moduleAppClass = className;
|
||||
}
|
||||
});
|
||||
if (moduleAppClass) {
|
||||
let moduleAppKey = 'admin-interface.foldable-apps_' + moduleAppClass + '_collapsed';
|
||||
let moduleCollapsed = Boolean(parseInt((localStorage.getItem(moduleAppKey) || 0)) || 0);
|
||||
if (moduleCollapsed === true) {
|
||||
moduleEl.classList.add(moduleCollapsedClass);
|
||||
} else {
|
||||
moduleEl.classList.remove(moduleCollapsedClass);
|
||||
}
|
||||
// attach click for togggle collapsed class
|
||||
for (let captionEl of moduleEl.querySelectorAll('caption')) {
|
||||
captionEl.onclick = function(event) {
|
||||
// only when not clicking on the app name link
|
||||
if (event.target.tagName.toLowerCase() === 'caption') {
|
||||
moduleEl.classList.toggle(moduleCollapsedClass);
|
||||
moduleCollapsed = moduleEl.classList.contains(moduleCollapsedClass);
|
||||
localStorage.setItem(moduleAppKey, (moduleCollapsed ? 1 : 0));
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
moduleEl.classList.add('foldable-apps-ready');
|
||||
}
|
||||
};
|
||||
})();
|
||||
Reference in New Issue
Block a user