Loading template/app/controller/Classes.js +11 −0 Original line number Diff line number Diff line Loading @@ -34,6 +34,14 @@ Ext.define('Docs.controller.Classes', { { ref: 'tree', selector: 'classtree' }, { ref: 'favoritesGrid', selector: '#favorites-grid' }, { ref: 'historyGrid', selector: '#history-grid' } ], Loading Loading @@ -190,6 +198,9 @@ Ext.define('Docs.controller.Classes', { } this.currentCls = cls; this.getFavoritesGrid().selectClass(cls.name); this.getHistoryGrid().selectClass(cls.name); }, showGuide: function(name, noHistory) { Loading template/app/view/ClassGrid.js +15 −0 Original line number Diff line number Diff line Loading @@ -60,6 +60,21 @@ Ext.define('Docs.view.ClassGrid', { this.getSelectionModel().on("select", function(sm, r) { this.fireEvent("classselect", r.get("cls")); }, this); }, /** * Selects class if grid contains such class. * Fires no events while selecting. * @param {String} cls class name. */ selectClass: function(cls) { var index = this.getStore().findExact('cls', cls); if (index > -1) { this.getSelectionModel().select(index, false, true); } else { this.getSelectionModel().deselectAll(true); } } }); template/app/view/Viewport.js +2 −0 Original line number Diff line number Diff line Loading @@ -87,6 +87,7 @@ Ext.define('Docs.view.Viewport', { items: [ { xtype: 'classgrid', id: 'favorites-grid', title: 'Favorites', store: Ext.getStore('Favorites'), icons: Docs.icons, Loading @@ -98,6 +99,7 @@ Ext.define('Docs.view.Viewport', { }, { xtype: 'classgrid', id: 'history-grid', title: 'History', store: Ext.getStore('History'), icons: Docs.icons, Loading Loading
template/app/controller/Classes.js +11 −0 Original line number Diff line number Diff line Loading @@ -34,6 +34,14 @@ Ext.define('Docs.controller.Classes', { { ref: 'tree', selector: 'classtree' }, { ref: 'favoritesGrid', selector: '#favorites-grid' }, { ref: 'historyGrid', selector: '#history-grid' } ], Loading Loading @@ -190,6 +198,9 @@ Ext.define('Docs.controller.Classes', { } this.currentCls = cls; this.getFavoritesGrid().selectClass(cls.name); this.getHistoryGrid().selectClass(cls.name); }, showGuide: function(name, noHistory) { Loading
template/app/view/ClassGrid.js +15 −0 Original line number Diff line number Diff line Loading @@ -60,6 +60,21 @@ Ext.define('Docs.view.ClassGrid', { this.getSelectionModel().on("select", function(sm, r) { this.fireEvent("classselect", r.get("cls")); }, this); }, /** * Selects class if grid contains such class. * Fires no events while selecting. * @param {String} cls class name. */ selectClass: function(cls) { var index = this.getStore().findExact('cls', cls); if (index > -1) { this.getSelectionModel().select(index, false, true); } else { this.getSelectionModel().deselectAll(true); } } });
template/app/view/Viewport.js +2 −0 Original line number Diff line number Diff line Loading @@ -87,6 +87,7 @@ Ext.define('Docs.view.Viewport', { items: [ { xtype: 'classgrid', id: 'favorites-grid', title: 'Favorites', store: Ext.getStore('Favorites'), icons: Docs.icons, Loading @@ -98,6 +99,7 @@ Ext.define('Docs.view.Viewport', { }, { xtype: 'classgrid', id: 'history-grid', title: 'History', store: Ext.getStore('History'), icons: Docs.icons, Loading