mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-19 00:11:49 +03:00
18 lines
350 B
JavaScript
18 lines
350 B
JavaScript
var TrimFocusInput = Ember.TextField.extend({
|
|
focus: true,
|
|
|
|
setFocus: function () {
|
|
if (this.focus) {
|
|
this.$().val(this.$().val()).focus();
|
|
}
|
|
}.on('didInsertElement'),
|
|
|
|
focusOut: function () {
|
|
var text = this.$().val();
|
|
|
|
this.$().val(text.trim());
|
|
}
|
|
});
|
|
|
|
export default TrimFocusInput;
|