2014-06-23 21:50:28 +04:00
|
|
|
var TrimFocusInput = Ember.TextField.extend({
|
2014-08-08 17:30:51 +04:00
|
|
|
focus: true,
|
|
|
|
|
2014-06-23 21:50:28 +04:00
|
|
|
setFocus: function () {
|
2014-08-08 17:30:51 +04:00
|
|
|
if (this.focus) {
|
|
|
|
this.$().val(this.$().val()).focus();
|
|
|
|
}
|
2014-06-23 21:50:28 +04:00
|
|
|
}.on('didInsertElement'),
|
|
|
|
|
|
|
|
focusOut: function () {
|
|
|
|
var text = this.$().val();
|
|
|
|
|
|
|
|
this.$().val(text.trim());
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
export default TrimFocusInput;
|