Index: gc_lang/fr/webext/content_scripts/menu.js ================================================================== --- gc_lang/fr/webext/content_scripts/menu.js +++ gc_lang/fr/webext/content_scripts/menu.js @@ -12,23 +12,28 @@ this.xButton.onclick = () => { this.switchMenu(); }; this.xButton.style.zIndex = (xNode.style.zIndex.search(/^[0-9]+$/) !== -1) ? (parseInt(xNode.style.zIndex) + 1).toString() : xNode.style.zIndex; this.xMenu = this._createMenu(); let style = window.getComputedStyle(this.xNode); - this.topMargin = -1 * (8 + parseInt(style.marginBottom.replace('px', ''), 10)); + let topMargin = -1 * (8 + parseInt(style.marginBottom.replace('px', ''), 10)); + + let insAfterThis = this.xNode; + if ( document.location.host == "twitter.com" && this.xNode.classList.contains('rich-editor')){ + insAfterThis = this.xNode.parentNode; + } - this._insertAfter(this.xButton); - this.xButton.style.marginTop = this.topMargin + 'px'; + this._insertAfter(this.xButton, insAfterThis); + this.xButton.style.marginTop = topMargin + 'px'; - this._insertAfter(this.xMenu); - this.xMenu.style.marginTop = (this.topMargin + 8) + 'px'; + this._insertAfter(this.xMenu, insAfterThis); + this.xMenu.style.marginTop = (topMargin + 8) + 'px'; this._createListenersOnReferenceNode(); } - _insertAfter (xNewNode) { - this.xNode.parentNode.insertBefore(xNewNode, this.xNode.nextSibling); + _insertAfter (xNewNode, xReferenceNode) { + xReferenceNode.parentNode.insertBefore(xNewNode, xReferenceNode.nextSibling); } _createListenersOnReferenceNode () { this.xNode.addEventListener('focus', (e) => { this.xButton.style.display = "block";