Styled Nav Editor
Created new CSS styles for dash nav editor and updated the appropriate controller scripts. Also updated the icons for the main nav.toggle-buttons-#109
parent
1b89d1d072
commit
78bfe4596b
@ -0,0 +1,34 @@
|
|||||||
|
article[role="navigation"] {
|
||||||
|
width: 100%;
|
||||||
|
max-width: 900px;
|
||||||
|
margin: 100px auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
article[role="navigation"] > section > div.nav-item {
|
||||||
|
display: block;
|
||||||
|
width: 98%;
|
||||||
|
background: var(--white);
|
||||||
|
border-radius: 3px;
|
||||||
|
color: var(--highlight);
|
||||||
|
margin: 0 0 10px;
|
||||||
|
font-size: 1.5em;
|
||||||
|
cursor: move;
|
||||||
|
}
|
||||||
|
|
||||||
|
article[role="navigation"] > section > div.nav-item > label {
|
||||||
|
display: inline-block;
|
||||||
|
padding: 5px;
|
||||||
|
margin: 12px 0 0 10px;
|
||||||
|
vertical-align: top;
|
||||||
|
cursor: move;
|
||||||
|
}
|
||||||
|
|
||||||
|
article[role="navigation"] > section > div.nav-item > div#nav-btns {
|
||||||
|
float: right;
|
||||||
|
padding: 5px;
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
|
||||||
|
article[role="navigation"] > section > div.nav-item > div#nav-btns button {
|
||||||
|
margin-left: 5px;
|
||||||
|
}
|
@ -1,37 +1,35 @@
|
|||||||
export default class NavActions {
|
export default class NavActions {
|
||||||
//--------------------------
|
//--------------------------
|
||||||
// constructor
|
// constructor
|
||||||
//--------------------------
|
//--------------------------
|
||||||
constructor() {}
|
constructor() {}
|
||||||
//--------------------------
|
//--------------------------
|
||||||
// methods
|
// methods
|
||||||
//--------------------------
|
//--------------------------
|
||||||
syncMenu() {
|
syncMenu() {
|
||||||
let navData = [];
|
let navData = [];
|
||||||
let items = document.getElementById("nav-pages").children;
|
let items = document.getElementById('nav-items').children;
|
||||||
for (let index = 0; index < items.length; index++) {
|
for (let index = 0; index < items.length; index++) {
|
||||||
navData.push({
|
navData.push({
|
||||||
title: items[index].getElementsByTagName("label")[0].innerHTML,
|
title: items[index].getElementsByTagName('label')[0].innerHTML,
|
||||||
id: items[index].id,
|
id: items[index].id,
|
||||||
slug: items[index].getAttribute("data-slug"),
|
slug: items[index].getAttribute('data-slug'),
|
||||||
uuid: items[index].getAttribute("data-uuid"),
|
uuid: items[index].getAttribute('data-uuid'),
|
||||||
path: items[index].getAttribute("data-path")
|
path: items[index].getAttribute('data-path')
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
let data = { menu: navData, remove: null };
|
let data = { menu: navData, remove: null };
|
||||||
return new Promise(function (resolve) {
|
return new Promise(function (resolve) {
|
||||||
resolve(data);
|
resolve(data);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
removeItem(id) {
|
removeItem(id) {
|
||||||
document
|
document.getElementById('nav-items').removeChild(document.getElementById(id));
|
||||||
.getElementById("nav-pages")
|
}
|
||||||
.removeChild(document.getElementById(id));
|
|
||||||
}
|
|
||||||
|
|
||||||
//--------------------------
|
//--------------------------
|
||||||
// event handlers
|
// event handlers
|
||||||
//--------------------------
|
//--------------------------
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue