Loading template/app/Application.js +16 −3 Original line number Diff line number Diff line Loading @@ -19,14 +19,27 @@ Ext.define('Docs.Application', { 'Search' ], autoCreateViewport: true, launch: function() { Docs.App = this; Docs.Favorites.init(); Docs.History.init(); Docs.Settings.init(); Ext.create('Docs.view.Viewport'); Ext.getStore('Settings').on('load', function(store) { var favHeight = Docs.Settings.get('favorites-height'); if (favHeight) { var tabPanel = Ext.getCmp('classes-tab-panel'); tabPanel.suspendEvents(); tabPanel.setHeight(favHeight); tabPanel.resumeEvents(); } }); Docs.History.init(); // When google analytics event tracking script present on page if (Docs.initEventTracking) { Docs.initEventTracking(); Loading template/app/Settings.js +3 −4 Original line number Diff line number Diff line Loading @@ -15,11 +15,10 @@ Ext.define("Docs.Settings", { set: function(key, value) { var index = this.store.findExact("key", key); if (index > -1) { this.store.getAt(index).set({key: key, value: value}); this.store.removeAt(index); } else { this.store.add({key: key, value: value}); } this.syncStore(); }, Loading template/app/controller/Classes.js +5 −5 Original line number Diff line number Diff line Loading @@ -74,7 +74,7 @@ Ext.define('Docs.controller.Classes', { ); Ext.getBody().addListener('click', function(event, el) { (event.button === this.MIDDLE) ? window.open(el.href) : this.loadClass(el.rel); (event.button === this.MIDDLE || event.shiftKey || event.ctrlKey) ? window.open(el.href) : this.loadClass(el.rel); }, this, { preventDefault: true, delegate: '.docClass' Loading Loading @@ -135,6 +135,10 @@ Ext.define('Docs.controller.Classes', { var cls = clsUrl; var member; if (!noHistory) { Docs.History.push("/api/" + clsUrl); } Ext.getCmp('card-panel').layout.setActiveItem(1); // separate class and member name Loading @@ -144,10 +148,6 @@ Ext.define('Docs.controller.Classes', { member = matches[2]; } if (!noHistory) { Docs.History.push("/api/" + clsUrl); } if (this.cache[cls]) { this.showClass(this.cache[cls], member); } else { Loading template/app/view/ClassGrid.js +3 −3 Original line number Diff line number Diff line Loading @@ -75,9 +75,9 @@ Ext.define('Docs.view.ClassGrid', { // of the clicked-on item should not happen. When it needs to // be selected, the #showClass method in Class controller will // explicitly call #selectClass. this.on("beforeselect", function() { return false; }, this); // this.on("beforeselect", function() { // return false; // }, this); this.on("itemclick", function(view, record, item, index, event) { // Don't fire classclick when close button clicked Loading template/app/view/Viewport.js +17 −1 Original line number Diff line number Diff line Loading @@ -94,6 +94,14 @@ Ext.define('Docs.view.Viewport', { afterRender: function() { // Add 7px padding at left side of tab-bar this.tabBar.insert(0, {width: 7, xtype: 'container'}); this.on('resize', function(cls, w, h) { Docs.Settings.set('favorites-height', h) }); var favHeight = Docs.Settings.get('favorites-height'); if (favHeight) { this.setHeight(favHeight); } } }, items: [ Loading @@ -107,7 +115,15 @@ Ext.define('Docs.view.Viewport', { pluginId: 'favGridDD', ptype: 'gridviewdragdrop', dragText: 'Drag and drop to reorganize' }] }], listeners: { drop: 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})) } } }, store: Ext.getStore('Favorites'), icons: Docs.icons, Loading Loading
template/app/Application.js +16 −3 Original line number Diff line number Diff line Loading @@ -19,14 +19,27 @@ Ext.define('Docs.Application', { 'Search' ], autoCreateViewport: true, launch: function() { Docs.App = this; Docs.Favorites.init(); Docs.History.init(); Docs.Settings.init(); Ext.create('Docs.view.Viewport'); Ext.getStore('Settings').on('load', function(store) { var favHeight = Docs.Settings.get('favorites-height'); if (favHeight) { var tabPanel = Ext.getCmp('classes-tab-panel'); tabPanel.suspendEvents(); tabPanel.setHeight(favHeight); tabPanel.resumeEvents(); } }); Docs.History.init(); // When google analytics event tracking script present on page if (Docs.initEventTracking) { Docs.initEventTracking(); Loading
template/app/Settings.js +3 −4 Original line number Diff line number Diff line Loading @@ -15,11 +15,10 @@ Ext.define("Docs.Settings", { set: function(key, value) { var index = this.store.findExact("key", key); if (index > -1) { this.store.getAt(index).set({key: key, value: value}); this.store.removeAt(index); } else { this.store.add({key: key, value: value}); } this.syncStore(); }, Loading
template/app/controller/Classes.js +5 −5 Original line number Diff line number Diff line Loading @@ -74,7 +74,7 @@ Ext.define('Docs.controller.Classes', { ); Ext.getBody().addListener('click', function(event, el) { (event.button === this.MIDDLE) ? window.open(el.href) : this.loadClass(el.rel); (event.button === this.MIDDLE || event.shiftKey || event.ctrlKey) ? window.open(el.href) : this.loadClass(el.rel); }, this, { preventDefault: true, delegate: '.docClass' Loading Loading @@ -135,6 +135,10 @@ Ext.define('Docs.controller.Classes', { var cls = clsUrl; var member; if (!noHistory) { Docs.History.push("/api/" + clsUrl); } Ext.getCmp('card-panel').layout.setActiveItem(1); // separate class and member name Loading @@ -144,10 +148,6 @@ Ext.define('Docs.controller.Classes', { member = matches[2]; } if (!noHistory) { Docs.History.push("/api/" + clsUrl); } if (this.cache[cls]) { this.showClass(this.cache[cls], member); } else { Loading
template/app/view/ClassGrid.js +3 −3 Original line number Diff line number Diff line Loading @@ -75,9 +75,9 @@ Ext.define('Docs.view.ClassGrid', { // of the clicked-on item should not happen. When it needs to // be selected, the #showClass method in Class controller will // explicitly call #selectClass. this.on("beforeselect", function() { return false; }, this); // this.on("beforeselect", function() { // return false; // }, this); this.on("itemclick", function(view, record, item, index, event) { // Don't fire classclick when close button clicked Loading
template/app/view/Viewport.js +17 −1 Original line number Diff line number Diff line Loading @@ -94,6 +94,14 @@ Ext.define('Docs.view.Viewport', { afterRender: function() { // Add 7px padding at left side of tab-bar this.tabBar.insert(0, {width: 7, xtype: 'container'}); this.on('resize', function(cls, w, h) { Docs.Settings.set('favorites-height', h) }); var favHeight = Docs.Settings.get('favorites-height'); if (favHeight) { this.setHeight(favHeight); } } }, items: [ Loading @@ -107,7 +115,15 @@ Ext.define('Docs.view.Viewport', { pluginId: 'favGridDD', ptype: 'gridviewdragdrop', dragText: 'Drag and drop to reorganize' }] }], listeners: { drop: 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})) } } }, store: Ext.getStore('Favorites'), icons: Docs.icons, Loading