FIX: Error finding $fields.position during tests

This commit is contained in:
Robin Ward 2016-11-22 14:28:10 -05:00
parent 217007ff54
commit f51bf2358e

View File

@ -35,9 +35,11 @@ export default Ember.Component.extend({
// Figure out the size of the fields
const $fields = this.$('.composer-fields');
const fieldPos = $fields.position();
if (fieldPos) {
this.$('.wmd-controls').css('top', $fields.height() + fieldPos.top + 5);
if ($fields) {
const fieldPos = $fields.position();
if (fieldPos) {
this.$('.wmd-controls').css('top', $fields.height() + fieldPos.top + 5);
}
}
// get the submit panel height