fipamo/src/com/actions/NavActions.js

29 lines
774 B
JavaScript
Raw Normal View History

export default class NavActions {
//--------------------------
// constructor
//--------------------------
2019-11-29 22:43:55 +01:00
constructor() {}
//--------------------------
// methods
//--------------------------
syncMenu() {
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'),
uuid: items[index].getAttribute('data-uuid'),
path: items[index].getAttribute('data-path')
});
}
return new Promise(function (resolve) {
resolve(navData);
});
}
//--------------------------
// event handlers
//--------------------------
}