Ghost/core/client/components/gh-trim-focus-input.js
Hannah Wolfe fbccc36f77 More autosave improvements
issue #4305, issue #4259, issue #1413

- change new->edit transitionToRoute to be replaceRoute
- auto focus in the editor on transition to the edit route
- change the one-time autosave to happen on codemirror focusin instead of title focusout
- re-add removed tests, and reorder broken test
2014-10-18 17:27:05 +02:00

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;