mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-15 11:34:24 +03:00
fbccc36f77
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
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;
|