Merge pull request #3905 from scossar/rtl-d-editor-modal

FIX: check for site direction before positioning d-editor-modal
This commit is contained in:
Sam 2015-11-19 20:00:56 +11:00
commit 116c2be6c7

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();
});