From c315b51430f5259b77c03477405c1c79973bda4b Mon Sep 17 00:00:00 2001 From: Rene Saarsoo Date: Wed, 25 May 2011 14:42:07 +0300 Subject: [PATCH] Turn History menu on again. Fix adding items to history by setting correct itemSelector for HistoryItems view. Wrong selector caused crash when menu had been already rendered. --- template/app/controller/Classes.js | 10 +++---- template/app/view/tree/HistoryItems.js | 2 +- template/app/view/tree/Tree.js | 40 +++++++++++++------------- 3 files changed, 26 insertions(+), 26 deletions(-) diff --git a/template/app/controller/Classes.js b/template/app/controller/Classes.js index 6282c55b..d09954b1 100644 --- a/template/app/controller/Classes.js +++ b/template/app/controller/Classes.js @@ -131,11 +131,11 @@ 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(); - // } + var prevCls = historyStore.find('cls', cls.name); + if (prevCls === -1) { + historyStore.add({cls: cls.name}); + historyStore.sync(); + } Ext.getCmp('treePanelCmp').selectClass(cls.name); } diff --git a/template/app/view/tree/HistoryItems.js b/template/app/view/tree/HistoryItems.js index 987bf54c..3d4994b9 100644 --- a/template/app/view/tree/HistoryItems.js +++ b/template/app/view/tree/HistoryItems.js @@ -4,7 +4,7 @@ Ext.define('Docs.view.tree.HistoryItems', { extend: 'Ext.view.View', - itemSelector: 'div.a', + itemSelector: 'div.item', emptyText: 'No history', renderTo: Ext.getBody(), cls: 'hover-menu-menu show', diff --git a/template/app/view/tree/Tree.js b/template/app/view/tree/Tree.js index 3c2e7cc7..bdc29067 100644 --- a/template/app/view/tree/Tree.js +++ b/template/app/view/tree/Tree.js @@ -14,26 +14,26 @@ Ext.define('Docs.view.tree.Tree', { border: false, bodyBorder: false, - // dockedItems: [ - // { - // xtype: 'container', - // layout: { - // type: 'hbox' - // }, - // dock: 'top', - // margin: '0 0 15 0', - // items: [ - // { - // margin: '0 10 0 0', - // xtype: 'button', - // text: 'Favorites' - // }, - // { - // xtype: 'docshistorybutton' - // } - // ] - // } - // ], + dockedItems: [ + { + xtype: 'container', + layout: { + type: 'hbox' + }, + dock: 'top', + margin: '0 0 15 0', + items: [ + { + margin: '0 10 0 0', + xtype: 'button', + text: 'Favorites' + }, + { + xtype: 'docshistorybutton' + } + ] + } + ], initComponent: function() { // Expand the main tree -- GitLab