From a9ab3f9ef0ee405aaa5401aefc87c04a3d345299 Mon Sep 17 00:00:00 2001 From: Joffrey JAFFEUX Date: Thu, 20 Jul 2017 17:03:45 +0200 Subject: [PATCH] FIX: emoji-picker positioning glitches on few edge cases --- .../discourse/components/emoji-picker.js.es6 | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/app/assets/javascripts/discourse/components/emoji-picker.js.es6 b/app/assets/javascripts/discourse/components/emoji-picker.js.es6 index fc63413df6a..3f2f511695b 100644 --- a/app/assets/javascripts/discourse/components/emoji-picker.js.es6 +++ b/app/assets/javascripts/discourse/components/emoji-picker.js.es6 @@ -15,7 +15,7 @@ const PER_ROW = 11; const customEmojis = _.map(_.keys(extendedEmojiList()), code => { return { code, src: emojiUrlFor(code) }; }); -let $picker, $modal, $filter, $results, $list; +let $picker, $filter, $results, $list; export default Ember.Component.extend({ willDestroyElement() { @@ -371,8 +371,8 @@ export default Ember.Component.extend({ const desktopModalePositioning = options => { const attributes = { - width: windowWidth < 450 ? windowWidth - 12 : 400, - marginLeft: -($picker.width() / 2) + 12, + width: Math.min(windowWidth, 400) - 12, + marginLeft: -(Math.min(windowWidth, 400)/2) + 6, marginTop: -130, left: "50%", bottom: "", @@ -403,7 +403,7 @@ export default Ember.Component.extend({ const desktopPositioning = options => { const attributes = { - width: windowWidth < 450 ? windowWidth - 12 : 400, + width: windowWidth < 485 ? windowWidth - 12 : 400, marginLeft: "", marginTop: "", right: "", @@ -424,7 +424,7 @@ export default Ember.Component.extend({ } else { if(this._isReplyControlExpanded()) { let $editorWrapper = Ember.$(".d-editor-preview-wrapper"); - if(($editorWrapper.is(":visible") && $editorWrapper.width() < 400) || windowWidth < 450) { + if(($editorWrapper.is(":visible") && $editorWrapper.width() < 400) || windowWidth < 485) { desktopModalePositioning(); } else { if($editorWrapper.is(":visible")) { @@ -439,7 +439,7 @@ export default Ember.Component.extend({ } } } else { - if(windowWidth < 450) { + if(windowWidth < 485) { desktopModalePositioning(); } else { let previewInputOffset = Ember.$(".d-editor-input").offset();