2019-11-22 07:36:18 +01:00
|
|
|
export default class NavActions {
|
|
|
|
//--------------------------
|
|
|
|
// constructor
|
|
|
|
//--------------------------
|
2019-11-29 22:43:55 +01:00
|
|
|
constructor() {}
|
2019-11-22 07:36:18 +01:00
|
|
|
//--------------------------
|
|
|
|
// methods
|
|
|
|
//--------------------------
|
2020-05-23 22:55:25 +02:00
|
|
|
syncMenu() {
|
2019-11-22 07:36:18 +01:00
|
|
|
let navData = [];
|
|
|
|
let items = document.getElementById('nav-pages').children;
|
|
|
|
for (let index = 0; index < items.length; index++) {
|
|
|
|
navData.push({
|
|
|
|
title: items[index].getElementsByTagName('label')[0].innerHTML,
|
|
|
|
id: items[index].id,
|
|
|
|
slug: items[index].getAttribute('data-slug'),
|
2020-06-11 22:22:00 +02:00
|
|
|
uuid: items[index].getAttribute('data-uuid'),
|
|
|
|
path: items[index].getAttribute('data-path')
|
2019-11-22 07:36:18 +01:00
|
|
|
});
|
|
|
|
}
|
2020-05-23 22:55:25 +02:00
|
|
|
return new Promise(function (resolve) {
|
|
|
|
resolve(navData);
|
2019-11-22 07:36:18 +01:00
|
|
|
});
|
|
|
|
}
|
|
|
|
//--------------------------
|
|
|
|
// event handlers
|
|
|
|
//--------------------------
|
|
|
|
}
|