mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-11 16:05:44 +01:00
fix bug in Sonia.util.Link
This commit is contained in:
@@ -69,12 +69,8 @@ Sonia.repository.ExtendedInfoPanel = Ext.extend(Sonia.repository.InfoPanel,{
|
||||
xtype: 'link',
|
||||
colspan: 2,
|
||||
text: this.repositoryBrowserText,
|
||||
listeners: {
|
||||
click: {
|
||||
fn: this.openRepositoryBrowser,
|
||||
handler: this.openRepositoryBrowser,
|
||||
scope: this
|
||||
}
|
||||
}
|
||||
};
|
||||
},
|
||||
|
||||
|
||||
@@ -143,12 +143,8 @@ Sonia.repository.InfoPanel = Ext.extend(Ext.Panel, {
|
||||
xtype: 'link',
|
||||
colspan: 2,
|
||||
text: this.changesetViewerText,
|
||||
listeners: {
|
||||
click: {
|
||||
fn: this.openChangesetViewer,
|
||||
handler: this.openChangesetViewer,
|
||||
scope: this
|
||||
}
|
||||
}
|
||||
};
|
||||
},
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user