mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-27 17:46:05 -05:00
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:
commit
116c2be6c7
1 changed files with 3 additions and 1 deletions
|
@ -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();
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue