mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06: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
@ -11,7 +11,9 @@ export default Ember.Component.extend({
|
|||||||
const $parent = this.$().closest('.d-editor');
|
const $parent = this.$().closest('.d-editor');
|
||||||
const w = $parent.width();
|
const w = $parent.width();
|
||||||
const h = $parent.height();
|
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});
|
parent.$('.d-editor-overlay').removeClass('hidden').css({ width: w, height: h});
|
||||||
this.$('input').focus();
|
this.$('input').focus();
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user