Ghost/ghost/admin/components/gh-trim-focus-input.js

14 lines
292 B
JavaScript
Raw Normal View History

var TrimFocusInput = Ember.TextField.extend({
setFocus: function () {
this.$().val(this.$().val()).focus();
}.on('didInsertElement'),
focusOut: function () {
var text = this.$().val();
this.$().val(text.trim());
}
});
export default TrimFocusInput;