From d7a20c8e93ca1979e65fa94cc3b85ecbb3c621ed Mon Sep 17 00:00:00 2001 From: Joffrey JAFFEUX Date: Thu, 20 Jul 2017 20:27:59 +0200 Subject: [PATCH] FIX: Object.assign is not supported in all browsers --- .../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 9e5797d88c1..feb18dc5a93 100644 --- a/app/assets/javascripts/discourse/components/emoji-picker.js.es6 +++ b/app/assets/javascripts/discourse/components/emoji-picker.js.es6 @@ -370,7 +370,7 @@ export default Ember.Component.extend({ let windowWidth = this.$(window).width(); const desktopModalePositioning = options => { - const attributes = { + let attributes = { width: Math.min(windowWidth, 400) - 12, marginLeft: -(Math.min(windowWidth, 400)/2) + 6, marginTop: -130, @@ -379,14 +379,14 @@ export default Ember.Component.extend({ top: "50%", display: "flex" }; - Object.assign(attributes, options); + attributes = _.merge(attributes, options); this.$(".emoji-picker-modal").addClass("fadeIn"); $picker.css(attributes); }; const mobilePositioning = options => { - const attributes = { + let attributes = { width: windowWidth - 12, marginLeft: 5, marginTop: -130, @@ -395,14 +395,14 @@ export default Ember.Component.extend({ top: "50%", display: "flex" }; - Object.assign(attributes, options); + attributes = _.merge(attributes, options); this.$(".emoji-picker-modal").addClass("fadeIn"); $picker.css(attributes); }; const desktopPositioning = options => { - const attributes = { + let attributes = { width: windowWidth < 485 ? windowWidth - 12 : 400, marginLeft: "", marginTop: "", @@ -413,7 +413,7 @@ export default Ember.Component.extend({ display: "flex" }; - Object.assign(attributes, options); + attributes = _.merge(attributes, options); this.$(".emoji-picker-modal").removeClass("fadeIn"); $picker.css(attributes);