Index: gc_lang/fr/webext/content_scripts/panel.js ================================================================== --- gc_lang/fr/webext/content_scripts/panel.js +++ gc_lang/fr/webext/content_scripts/panel.js @@ -128,10 +128,14 @@ adjustHeight () { this.xPanelContent.style.height = this.xPanelContent.firstChild.offsetHeight + "px"; // xPanelContent has only one child this.xPanel.style.height = this.xPanelBar.offsetHeight + this.xPanelContent.offsetHeight + 10 + "px"; } + + getWidth () { + return this.xPanelContent.offsetWidth; + } logInnerHTML () { // for debugging console.log(this.xPanel.innerHTML); } Index: gc_lang/fr/webext/content_scripts/panel_gc.js ================================================================== --- gc_lang/fr/webext/content_scripts/panel_gc.js +++ gc_lang/fr/webext/content_scripts/panel_gc.js @@ -306,11 +306,11 @@ show (sNodeErrorId) { // err try { let xNodeErr = document.getElementById(sNodeErrorId); this.sErrorId = xNodeErr.dataset.error_id; // we store error_id here to know if spell_suggestions are given to the right word. - let nLimit = 500 - 330; // paragraph width - tooltip width + let nLimit = oGrammalecte.oGCPanel.getWidth() - 330; // paragraph width - tooltip width this.xTooltipArrow.style.top = (xNodeErr.offsetTop + 16) + "px"; this.xTooltipArrow.style.left = (xNodeErr.offsetLeft + Math.floor((xNodeErr.offsetWidth / 2))-4) + "px"; // 4 is half the width of the arrow. this.xTooltip.style.top = (xNodeErr.offsetTop + 20) + "px"; this.xTooltip.style.left = (xNodeErr.offsetLeft > nLimit) ? nLimit + "px" : xNodeErr.offsetLeft + "px"; if (xNodeErr.dataset.error_type === "grammar") {