Loading template/app/Favorites.js +11 −0 Original line number Diff line number Diff line Loading @@ -84,5 +84,16 @@ Ext.define("Docs.Favorites", { */ getCount: function() { return this.store.getCount(); }, /** * Save order of favorites in store. * * This needs to be called explicitly, because of a bug in * localStorage which prevents the order of items being saved when * they're changed. */ saveOrder: function() { this.store.getProxy().setIds(Ext.Array.map(this.store.data.items, function(i) { return i.data.id; })); } }); template/app/controller/Favorites.js +1 −4 Original line number Diff line number Diff line Loading @@ -34,10 +34,7 @@ Ext.define('Docs.controller.Favorites', { Docs.Favorites.remove(url); }, reorder: function() { // Hack to fix a bug in localStorage which prevents the order of // items being saved when they're changed var store = Ext.getStore('Favorites'); store.getProxy().setIds(Ext.Array.map(store.data.items, function(i) { return i.data.id; })); Docs.Favorites.saveOrder(); } }, 'classtree': { Loading Loading
template/app/Favorites.js +11 −0 Original line number Diff line number Diff line Loading @@ -84,5 +84,16 @@ Ext.define("Docs.Favorites", { */ getCount: function() { return this.store.getCount(); }, /** * Save order of favorites in store. * * This needs to be called explicitly, because of a bug in * localStorage which prevents the order of items being saved when * they're changed. */ saveOrder: function() { this.store.getProxy().setIds(Ext.Array.map(this.store.data.items, function(i) { return i.data.id; })); } });
template/app/controller/Favorites.js +1 −4 Original line number Diff line number Diff line Loading @@ -34,10 +34,7 @@ Ext.define('Docs.controller.Favorites', { Docs.Favorites.remove(url); }, reorder: function() { // Hack to fix a bug in localStorage which prevents the order of // items being saved when they're changed var store = Ext.getStore('Favorites'); store.getProxy().setIds(Ext.Array.map(store.data.items, function(i) { return i.data.id; })); Docs.Favorites.saveOrder(); } }, 'classtree': { Loading