From 203c1d34e35fe5a220000340c72e30232fe1e12a Mon Sep 17 00:00:00 2001 From: Rene Saarsoo Date: Tue, 7 Feb 2012 18:43:15 -0800 Subject: [PATCH] Fix scrolling to members section on HoverMenuButton click. This time implement it without a hacky access to parent component. --- template/app/view/cls/Overview.js | 3 +++ template/app/view/cls/Toolbar.js | 8 +++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/template/app/view/cls/Overview.js b/template/app/view/cls/Overview.js index 231aa2d8..9646a417 100644 --- a/template/app/view/cls/Overview.js +++ b/template/app/view/cls/Overview.js @@ -79,6 +79,9 @@ Ext.define('Docs.view.cls.Overview', { filter: function(search, show) { this.filterMembers(search, show); }, + menubuttonclick: function(type) { + this.scrollToEl("h3.members-title.icon-"+type, -20); + }, scope: this } }); diff --git a/template/app/view/cls/Toolbar.js b/template/app/view/cls/Toolbar.js index 13e05128..55848b01 100644 --- a/template/app/view/cls/Toolbar.js +++ b/template/app/view/cls/Toolbar.js @@ -28,6 +28,12 @@ Ext.define('Docs.view.cls.Toolbar', { initComponent: function() { this.addEvents( + /** + * @event buttonclick + * Fired when one of the toolbar HoverMenuButtons is clicked. + * @param {String} type Type of button that was clicked "cfg", "method", "event", etc + */ + "menubuttonclick", /** * @event filter * Fires when text typed to filter, or one of the hide-checkboxes clicked. @@ -177,7 +183,7 @@ Ext.define('Docs.view.cls.Toolbar', { showCount: true, listeners: { click: function() { - this.up('classoverview').scrollToEl("#m-" + cfg.type); + this.fireEvent('menubuttonclick', cfg.type); }, scope: this } -- GitLab