check for direction

This commit is contained in:
scossar 2015-11-18 13:39:58 -08:00
parent 7f4ca91e06
commit 712b2cc435

View File

@ -11,7 +11,9 @@ export default Ember.Component.extend({
const $parent = this.$().closest('.d-editor');
const w = $parent.width();
const h = $parent.height();
$modal.css({ left: (w / 2) - ($modal.outerWidth() / 2) });
const dir = $('html').css('direction') === 'rtl' ? 'right' : 'left';
const offset = (w / 2) - ($modal.outerWidth() / 2);
$modal.css(dir, offset + 'px');
parent.$('.d-editor-overlay').removeClass('hidden').css({ width: w, height: h});
this.$('input').focus();
});