mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-24 11:22:19 +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;
|