Adding support to LocalStorage on client side

Save the state of the Menu Item between session (like activation of
node-status and sidebar)
This commit is contained in:
Antoine Aflalo
2014-10-30 16:19:44 +02:00
parent ed9951f065
commit 01f0d5390f
5 changed files with 143 additions and 29 deletions

View File

@@ -142,12 +142,9 @@ var RED = (function() {
});
function loadSettings() {
$.get('settings', function(data) {
RED.settings = data;
console.log("Node-RED: "+data.version);
loadNodeList();
});
RED.settings.init(loadNodeList);
}
function loadNodeList() {
$.ajax({
headers: {
@@ -286,7 +283,7 @@ var RED = (function() {
$(function() {
RED.menu.init({id:"btn-sidemenu",
options: [
{id:"btn-sidebar",icon:"fa fa-columns",label:"Sidebar",toggle:true,onselect:RED.sidebar.toggleSidebar},
{id:"btn-sidebar",icon:"fa fa-columns",label:"Sidebar",toggle:true,onselect:RED.sidebar.toggleSidebar, selected: true},
null,
{id:"btn-node-status",icon:"fa fa-info",label:"Node Status",toggle:true,onselect:toggleStatus},
null,