mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-11 07:55:47 +01:00
fix bug in Sonia.util.Link
This commit is contained in:
@@ -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