fipamo/brain/data/Navigation.js

37 lines
887 B
JavaScript

//import fh from 'filehound';
import fs from 'fs-extra';
//import metadataParser from 'markdown-yaml-metadata-parser';
import _ from 'lodash';
import * as DataEvent from '../../src/com/events/DataEvent';
//const moment = require('moment');
export default class Navigation {
//--------------------------
// constructor
//--------------------------
constructor() {}
//--------------------------
// methods
//--------------------------
start() {}
editMenu(task, item) {
switch (task) {
case DataEvent.MENU_ADD_ITEM:
break;
case DataEvent.MENU_DELETE_ITEM:
fs.readJSON('site/settings.json').then(settings => {
settings.menu = _.remove(settings.menu, m => {
return m.uuid != item.uuid;
});
fs.writeJSON('site/settings.json', settings);
});
break;
}
}
//--------------------------
// event handlers
//--------------------------
}