fix focus after attempting to onebox
This commit is contained in:
parent
fbd8e6ed4a
commit
03ec8f8089
|
@ -66,10 +66,12 @@ export default Ember.Component.extend({
|
||||||
this._updatePost(lookupCache(this.get('composer.title')));
|
this._updatePost(lookupCache(this.get('composer.title')));
|
||||||
}).finally(() => {
|
}).finally(() => {
|
||||||
this.set('composer.loading', false);
|
this.set('composer.loading', false);
|
||||||
|
Ember.run.schedule('afterRender', () => { this.$('input').putCursorAtEnd(); });
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
this._updatePost(loadOnebox);
|
this._updatePost(loadOnebox);
|
||||||
this.set('composer.loading', false);
|
this.set('composer.loading', false);
|
||||||
|
Ember.run.schedule('afterRender', () => { this.$('input').putCursorAtEnd(); });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -85,13 +87,17 @@ export default Ember.Component.extend({
|
||||||
this.set('composer.reply', this.get('composer.title'));
|
this.set('composer.reply', this.get('composer.title'));
|
||||||
|
|
||||||
if (header.length > 0 && header.text().length > 0) {
|
if (header.length > 0 && header.text().length > 0) {
|
||||||
this.set('composer.title', header.text().trim());
|
this.changeTitle(header.text());
|
||||||
} else {
|
} else {
|
||||||
const filename = (this.get('composer.featuredLink')||"").split("/").pop();
|
const filename = (this.get('composer.featuredLink')||"").split("/").pop();
|
||||||
if (filename && filename.length > 0) {
|
this.changeTitle(filename);
|
||||||
this.set('composer.title', filename.trim());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
changeTitle(val) {
|
||||||
|
if (val && val.length > 0) {
|
||||||
|
this.set('composer.title', val.trim());
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue