Loading template/app/History.js +20 −0 Original line number Diff line number Diff line Loading @@ -12,6 +12,7 @@ Ext.define("Docs.History", { this.navigate(Ext.util.History.getToken()); }, this); Ext.util.History.on("change", this.navigate, this); this.store = Ext.getStore("History"); }, // Parses current URL and navigates to the page Loading Loading @@ -39,6 +40,18 @@ Ext.define("Docs.History", { return matches ? {type: matches[1], key: matches[2]} : {}; }, // Extracts class name from history token // Returns false when it's not class-related token. parseClassName: function(token) { var url = this.parseToken(token); if (url.type === "api") { return url.key.replace(/-.*$/, ''); } else { return false; } }, /** * Adds URL to history * Loading @@ -47,5 +60,12 @@ Ext.define("Docs.History", { push: function(token) { this.ignoreChange = true; Ext.util.History.add(token); // Add class name to history store if it's not there already var cls = this.parseClassName(token); if (cls && this.store.find('cls', cls) === -1) { this.store.add({cls: cls}); this.store.sync(); } } }); template/app/controller/Classes.js +4 −9 Original line number Diff line number Diff line Loading @@ -19,7 +19,9 @@ Ext.define('Docs.controller.Classes', { 'History' ], models: ['History'], models: [ 'History' ], init: function() { Ext.getBody().addListener('click', function(cmp, el) { Loading Loading @@ -120,8 +122,7 @@ Ext.define('Docs.controller.Classes', { showClass = container.down('showclass'), classHeader = showClass.down('classheader'), classOverview = showClass.down('classoverview'), docTabPanel = Ext.getCmp('docTabPanel'), historyStore = this.getStore('History'); docTabPanel = Ext.getCmp('docTabPanel'); classHeader.update(classHeader.tpl.apply(cls)); classOverview.load(cls); Loading @@ -131,12 +132,6 @@ Ext.define('Docs.controller.Classes', { docTabPanel.setLoading(false); } var prevCls = historyStore.find('cls', cls.name); if (prevCls === -1) { historyStore.add({cls: cls.name}); historyStore.sync(); } Ext.getCmp('treePanelCmp').selectClass(cls.name); } Loading template/app/model/History.js +1 −1 Original line number Diff line number Diff line Loading @@ -2,7 +2,7 @@ * Previously visited classes / guides */ Ext.define('Docs.model.History', { fields: ['id', 'cls', 'scrollPosision', 'hideInherited', 'expandedMembers'], fields: ['id', 'cls'], extend: 'Ext.data.Model', proxy: { type: 'localstorage', Loading template/app/view/tree/HistoryItems.js +1 −1 Original line number Diff line number Diff line Loading @@ -12,7 +12,7 @@ Ext.define('Docs.view.tree.HistoryItems', { tpl: new Ext.XTemplate( '<tpl for=".">', '<div class="item">', '<a href="{cls}" rel="{cls}" class="docClass">{cls}</a>', '<a href="#/api/{cls}" rel="{cls}" class="docClass">{cls}</a>', '<a class="close" href="#" rel="{cls}">x</a>', '</div>', '</tpl>' Loading Loading
template/app/History.js +20 −0 Original line number Diff line number Diff line Loading @@ -12,6 +12,7 @@ Ext.define("Docs.History", { this.navigate(Ext.util.History.getToken()); }, this); Ext.util.History.on("change", this.navigate, this); this.store = Ext.getStore("History"); }, // Parses current URL and navigates to the page Loading Loading @@ -39,6 +40,18 @@ Ext.define("Docs.History", { return matches ? {type: matches[1], key: matches[2]} : {}; }, // Extracts class name from history token // Returns false when it's not class-related token. parseClassName: function(token) { var url = this.parseToken(token); if (url.type === "api") { return url.key.replace(/-.*$/, ''); } else { return false; } }, /** * Adds URL to history * Loading @@ -47,5 +60,12 @@ Ext.define("Docs.History", { push: function(token) { this.ignoreChange = true; Ext.util.History.add(token); // Add class name to history store if it's not there already var cls = this.parseClassName(token); if (cls && this.store.find('cls', cls) === -1) { this.store.add({cls: cls}); this.store.sync(); } } });
template/app/controller/Classes.js +4 −9 Original line number Diff line number Diff line Loading @@ -19,7 +19,9 @@ Ext.define('Docs.controller.Classes', { 'History' ], models: ['History'], models: [ 'History' ], init: function() { Ext.getBody().addListener('click', function(cmp, el) { Loading Loading @@ -120,8 +122,7 @@ Ext.define('Docs.controller.Classes', { showClass = container.down('showclass'), classHeader = showClass.down('classheader'), classOverview = showClass.down('classoverview'), docTabPanel = Ext.getCmp('docTabPanel'), historyStore = this.getStore('History'); docTabPanel = Ext.getCmp('docTabPanel'); classHeader.update(classHeader.tpl.apply(cls)); classOverview.load(cls); Loading @@ -131,12 +132,6 @@ Ext.define('Docs.controller.Classes', { docTabPanel.setLoading(false); } var prevCls = historyStore.find('cls', cls.name); if (prevCls === -1) { historyStore.add({cls: cls.name}); historyStore.sync(); } Ext.getCmp('treePanelCmp').selectClass(cls.name); } Loading
template/app/model/History.js +1 −1 Original line number Diff line number Diff line Loading @@ -2,7 +2,7 @@ * Previously visited classes / guides */ Ext.define('Docs.model.History', { fields: ['id', 'cls', 'scrollPosision', 'hideInherited', 'expandedMembers'], fields: ['id', 'cls'], extend: 'Ext.data.Model', proxy: { type: 'localstorage', Loading
template/app/view/tree/HistoryItems.js +1 −1 Original line number Diff line number Diff line Loading @@ -12,7 +12,7 @@ Ext.define('Docs.view.tree.HistoryItems', { tpl: new Ext.XTemplate( '<tpl for=".">', '<div class="item">', '<a href="{cls}" rel="{cls}" class="docClass">{cls}</a>', '<a href="#/api/{cls}" rel="{cls}" class="docClass">{cls}</a>', '<a class="close" href="#" rel="{cls}">x</a>', '</div>', '</tpl>' Loading