FIX: More robust `afterRender` for the composer
This commit is contained in:
parent
f51bf2358e
commit
ca5ed77b43
|
@ -28,27 +28,27 @@ export default Ember.Component.extend({
|
||||||
},
|
},
|
||||||
|
|
||||||
@observes('composeState', 'composer.action')
|
@observes('composeState', 'composer.action')
|
||||||
resize() {
|
resize() {
|
||||||
Ember.run.scheduleOnce('afterRender', () => {
|
Ember.run.scheduleOnce('afterRender', () => {
|
||||||
const h = $('#reply-control').height() || 0;
|
if (!this.element || this.isDestroying || this.isDestroyed) { return; }
|
||||||
this.movePanels(h + "px");
|
|
||||||
|
|
||||||
// Figure out the size of the fields
|
const h = $('#reply-control').height() || 0;
|
||||||
const $fields = this.$('.composer-fields');
|
this.movePanels(h + "px");
|
||||||
if ($fields) {
|
|
||||||
const fieldPos = $fields.position();
|
|
||||||
if (fieldPos) {
|
|
||||||
this.$('.wmd-controls').css('top', $fields.height() + fieldPos.top + 5);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// get the submit panel height
|
// Figure out the size of the fields
|
||||||
const submitPos = this.$('.submit-panel').position();
|
const $fields = this.$('.composer-fields');
|
||||||
if (submitPos) {
|
const fieldPos = $fields.position();
|
||||||
this.$('.wmd-controls').css('bottom', h - submitPos.top + 7);
|
if (fieldPos) {
|
||||||
}
|
this.$('.wmd-controls').css('top', $fields.height() + fieldPos.top + 5);
|
||||||
});
|
}
|
||||||
},
|
|
||||||
|
// get the submit panel height
|
||||||
|
const submitPos = this.$('.submit-panel').position();
|
||||||
|
if (submitPos) {
|
||||||
|
this.$('.wmd-controls').css('bottom', h - submitPos.top + 7);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
keyUp() {
|
keyUp() {
|
||||||
this.sendAction('typed');
|
this.sendAction('typed');
|
||||||
|
|
Loading…
Reference in New Issue