Created
December 28, 2011 14:21
-
-
Save dmackerman/1528095 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// *NOTE* : This is currently certified for Ext JS 3.0 - 3.3.1 | |
var win = new Ext.Window({ | |
height : 200, | |
width : 300, | |
layout : 'fit', | |
items : { | |
xtype : "textarea", | |
value : 'Click here, then click a button!' | |
}, | |
buttons : [ | |
{ | |
text : 'Steals focus!' | |
}, | |
{ | |
text : 'Does not steal focus!', | |
// @override | |
onMouseDown : function(e){ | |
if(!this.disabled && e.button === 0){ | |
e.stopEvent(); // injected line here | |
this.getClickEl(e).addClass('x-btn-click'); | |
this.doc.on('mouseup', this.onMouseUp, this); | |
} | |
}, | |
// @override | |
onMouseUp : function(e){ | |
if(e.button === 0){ | |
e.stopEvent(); // injected line here | |
this.getClickEl(e, true).removeClass('x-btn-click'); | |
this.doc.un('mouseup', this.onMouseUp, this); | |
} | |
} | |
} | |
] | |
}); | |
win.show(); | |
win.items.items[0].el.focus() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment