Ghost/ghost/admin/components/gh-trim-focus-input.js
Fabian Becker 8ab1ed1f13 Trim title in editor on blue/focusOut
closes #3040, fixes #3038
- Properly trim title
- Re-add casper test/adjust where necessary
- Rename gh-focus-input component
2014-06-23 20:07:34 +00:00

14 lines
292 B
JavaScript

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;