Loading template/app/Favorites.js +6 −3 Original line number Diff line number Diff line Loading @@ -9,8 +9,11 @@ Ext.define("Docs.Favorites", { */ init: function() { // Load Favorites from localStorage this.localStorage = ('localStorage' in window && window['localStorage'] !== null); this.store = Ext.getStore("Favorites"); this.store.load(); if (this.localStorage) this.store.load(); }, /** Loading @@ -21,7 +24,7 @@ Ext.define("Docs.Favorites", { add: function(cls) { if (!this.has(cls)) { this.store.add({cls: cls}); this.store.sync(); if (this.localStorage) this.store.sync(); } }, Loading @@ -33,7 +36,7 @@ Ext.define("Docs.Favorites", { remove: function(cls) { if (this.has(cls)) { this.store.removeAt(this.store.find('cls', cls)); this.store.sync(); if (this.localStorage) this.store.sync(); } }, Loading template/app/History.js +5 −3 Original line number Diff line number Diff line Loading @@ -16,8 +16,10 @@ Ext.define("Docs.History", { }, this); Ext.util.History.on("change", this.navigate, this); // Load History from localStorage this.localStorage = ('localStorage' in window && window['localStorage'] !== null); this.store = Ext.getStore("History"); this.store.load(); if (this.localStorage) this.store.load(); }, // Parses current URL and navigates to the page Loading Loading @@ -83,7 +85,7 @@ Ext.define("Docs.History", { while (this.store.getAt(this.maxHistoryLength)) { this.store.removeAt(this.maxHistoryLength); } this.store.sync(); if (this.localStorage) this.store.sync(); } }, Loading @@ -95,6 +97,6 @@ Ext.define("Docs.History", { removeClass: function(cls) { var index = this.store.find('cls', cls); this.store.removeAt(index); this.store.sync(); if (this.localStorage) this.store.sync(); } }); template/app/model/Favorite.js +1 −1 Original line number Diff line number Diff line Loading @@ -5,7 +5,7 @@ Ext.define('Docs.model.Favorite', { fields: ['id', 'cls'], extend: 'Ext.data.Model', proxy: { type: 'localstorage', type: ('localStorage' in window && window['localStorage'] !== null) ? 'localstorage' : 'memory', id : 'docs-favorites' } }); template/app/model/History.js +1 −1 Original line number Diff line number Diff line Loading @@ -5,7 +5,7 @@ Ext.define('Docs.model.History', { fields: ['id', 'cls'], extend: 'Ext.data.Model', proxy: { type: 'localstorage', type: ('localStorage' in window && window['localStorage'] !== null) ? 'localstorage' : 'memory', id : 'docs-history' } }); template/app/view/tree/Favorites.js +1 −0 Original line number Diff line number Diff line Loading @@ -28,6 +28,7 @@ Ext.define('Docs.view.tree.Favorites', { renderMenu: function() { this.hoverMenu = Ext.create('Docs.view.tree.HistoryItems', { emptyText: 'No favorites', store: Docs.App.getStore('Favorites') }); Loading Loading
template/app/Favorites.js +6 −3 Original line number Diff line number Diff line Loading @@ -9,8 +9,11 @@ Ext.define("Docs.Favorites", { */ init: function() { // Load Favorites from localStorage this.localStorage = ('localStorage' in window && window['localStorage'] !== null); this.store = Ext.getStore("Favorites"); this.store.load(); if (this.localStorage) this.store.load(); }, /** Loading @@ -21,7 +24,7 @@ Ext.define("Docs.Favorites", { add: function(cls) { if (!this.has(cls)) { this.store.add({cls: cls}); this.store.sync(); if (this.localStorage) this.store.sync(); } }, Loading @@ -33,7 +36,7 @@ Ext.define("Docs.Favorites", { remove: function(cls) { if (this.has(cls)) { this.store.removeAt(this.store.find('cls', cls)); this.store.sync(); if (this.localStorage) this.store.sync(); } }, Loading
template/app/History.js +5 −3 Original line number Diff line number Diff line Loading @@ -16,8 +16,10 @@ Ext.define("Docs.History", { }, this); Ext.util.History.on("change", this.navigate, this); // Load History from localStorage this.localStorage = ('localStorage' in window && window['localStorage'] !== null); this.store = Ext.getStore("History"); this.store.load(); if (this.localStorage) this.store.load(); }, // Parses current URL and navigates to the page Loading Loading @@ -83,7 +85,7 @@ Ext.define("Docs.History", { while (this.store.getAt(this.maxHistoryLength)) { this.store.removeAt(this.maxHistoryLength); } this.store.sync(); if (this.localStorage) this.store.sync(); } }, Loading @@ -95,6 +97,6 @@ Ext.define("Docs.History", { removeClass: function(cls) { var index = this.store.find('cls', cls); this.store.removeAt(index); this.store.sync(); if (this.localStorage) this.store.sync(); } });
template/app/model/Favorite.js +1 −1 Original line number Diff line number Diff line Loading @@ -5,7 +5,7 @@ Ext.define('Docs.model.Favorite', { fields: ['id', 'cls'], extend: 'Ext.data.Model', proxy: { type: 'localstorage', type: ('localStorage' in window && window['localStorage'] !== null) ? 'localstorage' : 'memory', id : 'docs-favorites' } });
template/app/model/History.js +1 −1 Original line number Diff line number Diff line Loading @@ -5,7 +5,7 @@ Ext.define('Docs.model.History', { fields: ['id', 'cls'], extend: 'Ext.data.Model', proxy: { type: 'localstorage', type: ('localStorage' in window && window['localStorage'] !== null) ? 'localstorage' : 'memory', id : 'docs-history' } });
template/app/view/tree/Favorites.js +1 −0 Original line number Diff line number Diff line Loading @@ -28,6 +28,7 @@ Ext.define('Docs.view.tree.Favorites', { renderMenu: function() { this.hoverMenu = Ext.create('Docs.view.tree.HistoryItems', { emptyText: 'No favorites', store: Docs.App.getStore('Favorites') }); Loading