diff --git a/scm-webapp/src/main/webapp/resources/js/repository/sonia.repository.extendedinfopanel.js b/scm-webapp/src/main/webapp/resources/js/repository/sonia.repository.extendedinfopanel.js index c558934169..af39536d8c 100644 --- a/scm-webapp/src/main/webapp/resources/js/repository/sonia.repository.extendedinfopanel.js +++ b/scm-webapp/src/main/webapp/resources/js/repository/sonia.repository.extendedinfopanel.js @@ -69,12 +69,8 @@ Sonia.repository.ExtendedInfoPanel = Ext.extend(Sonia.repository.InfoPanel,{ xtype: 'link', colspan: 2, text: this.repositoryBrowserText, - listeners: { - click: { - fn: this.openRepositoryBrowser, - scope: this - } - } + handler: this.openRepositoryBrowser, + scope: this }; }, diff --git a/scm-webapp/src/main/webapp/resources/js/repository/sonia.repository.infopanel.js b/scm-webapp/src/main/webapp/resources/js/repository/sonia.repository.infopanel.js index 997905f331..85663eb1b4 100644 --- a/scm-webapp/src/main/webapp/resources/js/repository/sonia.repository.infopanel.js +++ b/scm-webapp/src/main/webapp/resources/js/repository/sonia.repository.infopanel.js @@ -143,12 +143,8 @@ Sonia.repository.InfoPanel = Ext.extend(Ext.Panel, { xtype: 'link', colspan: 2, text: this.changesetViewerText, - listeners: { - click: { - fn: this.openChangesetViewer, - scope: this - } - } + handler: this.openChangesetViewer, + scope: this }; }, diff --git a/scm-webapp/src/main/webapp/resources/js/util/sonia.util.link.js b/scm-webapp/src/main/webapp/resources/js/util/sonia.util.link.js index cb2ce4ec08..ef1f82ac13 100644 --- a/scm-webapp/src/main/webapp/resources/js/util/sonia.util.link.js +++ b/scm-webapp/src/main/webapp/resources/js/util/sonia.util.link.js @@ -31,27 +31,25 @@ Sonia.util.Link = Ext.extend(Ext.BoxComponent, { + handler: null, + scope: null, + constructor: function(config) { config = config || {}; config.xtype = 'box'; config.autoEl = { tag: 'a', html: config.text, href: '#' }; - Sonia.util.Link.superclass.constructor.apply(this, arguments); - this.addEvents({ - 'click': true, - 'mouseover': true, - 'blur': true - }); - this.text = config.text; - }, - - onRender: function() { - theLnk = this; - this.constructor.superclass.onRender.apply(this, arguments); - if (!theLnk.disabled) { - this.el.on('blur', function(e) { theLnk.fireEvent('blur'); }); - this.el.on('click', function(e) { theLnk.fireEvent('click'); }); - this.el.on('mouseover', function(e) { theLnk.fireEvent('mouseover'); }); + config.listeners = { + render: function(c) { + c.getEl().on('click', function(){ + if (this.handler){ + this.scope ? this.handler.call(this.scope) : this.handler(); + } + }, this); + } } + + Sonia.util.Link.superclass.constructor.apply(this, arguments); + this.text = config.text; } });