From 712b2cc43542f098cf0aa1b62d6f421b1ccbf496 Mon Sep 17 00:00:00 2001 From: scossar Date: Wed, 18 Nov 2015 13:39:58 -0800 Subject: [PATCH] check for direction --- .../javascripts/discourse/components/d-editor-modal.js.es6 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/assets/javascripts/discourse/components/d-editor-modal.js.es6 b/app/assets/javascripts/discourse/components/d-editor-modal.js.es6 index 049914fe2c8..fc2206b8321 100644 --- a/app/assets/javascripts/discourse/components/d-editor-modal.js.es6 +++ b/app/assets/javascripts/discourse/components/d-editor-modal.js.es6 @@ -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(); });