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 @@ -32,11 +32,11 @@ this.center(); } _createPanel (sTitle) { try { - let xPanel = oGrammalecte.createNode("div", {id: this.sId, className: "grammalecte_panel"}); + let xPanel = oGrammalecte.createNode("div", {id: this.sId, className: "grammalecte_panel" }); this.xPanelBar.appendChild(oGrammalecte.createNode("div", {className: "grammalecte_panel_invisible_marker", textContent: "__grammalecte_panel__"})); this.xPanelBar.appendChild(this._createButtons()); let xTitle = oGrammalecte.createNode("div", {className: "grammalecte_panel_title"}); xTitle.appendChild(this._createLogo()); xTitle.appendChild(oGrammalecte.createNode("div", {className: "grammalecte_panel_label", textContent: sTitle})); @@ -124,33 +124,49 @@ oGrammalecte.clearRightClickedNode(); } center () { let nHeight = (this.bFlexible) ? window.innerHeight-100 : this.nHeight; - this.xPanel.style = `top: 50%; left: 50%; width: ${this.nWidth}px; height: ${nHeight}px; margin-top: -${nHeight/2}px; margin-left: -${this.nWidth/2}px;`; + //this.xPanel.style = `top: 50%; left: 50%; width: ${this.nWidth}px; height: ${nHeight}px; margin-top: -${nHeight/2}px; margin-left: -${this.nWidth/2}px;`; + this.setSizeAndPosition(`${this.nWidth}px`, `${nHeight}px`, "50%", "", "", "50%", `-${nHeight/2}px`, `-${this.nWidth/2}px`); } stickToLeft () { let nHeight = (this.bFlexible) ? window.innerHeight-100 : this.nHeight; - this.xPanel.style = `top: 50%; left: -2px; width: ${this.nWidth}px; height: ${nHeight}px; margin-top: -${nHeight/2}px;`; + //this.xPanel.style = `top: 50%; left: -2px; width: ${this.nWidth}px; height: ${nHeight}px; margin-top: -${nHeight/2}px;`; + this.setSizeAndPosition(`${this.nWidth}px`, `${nHeight}px`, "50%", "", "", "-2px", `-${nHeight/2}px`, ""); } stickToRight () { let nHeight = (this.bFlexible) ? window.innerHeight-100 : this.nHeight; - this.xPanel.style = `top: 50%; right: -2px; width: ${this.nWidth}px; height: ${nHeight}px; margin-top: -${nHeight/2}px;`; + //this.xPanel.style = `top: 50%; right: -2px; width: ${this.nWidth}px; height: ${nHeight}px; margin-top: -${nHeight/2}px;`; + this.setSizeAndPosition(`${this.nWidth}px`, `${nHeight}px`, "50%", "-2px", "", "", `-${nHeight/2}px`, ""); } stickToTop () { let nWidth = (this.bFlexible) ? Math.floor(window.innerWidth/2) : this.nWidth; let nHeight = (this.bFlexible) ? Math.floor(window.innerHeight*0.45) : this.nHeight; - this.xPanel.style = `top: -2px; left: 50%; width: ${nWidth}px; height: ${nHeight}px; margin-left: -${nWidth/2}px;`; + //this.xPanel.style = `top: -2px; left: 50%; width: ${nWidth}px; height: ${nHeight}px; margin-left: -${nWidth/2}px;`; + this.setSizeAndPosition(`${nWidth}px`, `${nHeight}px`, "-2px", "", "", "50%", "", `-${nWidth/2}px`); } stickToBottom () { let nWidth = (this.bFlexible) ? Math.floor(window.innerWidth/2) : this.nWidth; let nHeight = (this.bFlexible) ? Math.floor(window.innerHeight*0.45) : this.nHeight; - this.xPanel.style = `bottom: -2px; left: 50%; width: ${nWidth}px; height: ${nHeight}px; margin-left: -${nWidth/2}px;`; + //this.xPanel.style = `bottom: -2px; left: 50%; width: ${nWidth}px; height: ${nHeight}px; margin-left: -${nWidth/2}px;`; + this.setSizeAndPosition(`${nWidth}px`, `${nHeight}px`, "", "", "-2px", "50%", "", `-${nWidth/2}px`); + } + + setSizeAndPosition (sWidth, sHeight, sTop, sRight, sBottom, sLeft, sMarginTop, sMarginLeft) { + this.xPanel.style.width = sWidth; + this.xPanel.style.height = sHeight; + this.xPanel.style.top = sTop; + this.xPanel.style.right = sRight; + this.xPanel.style.bottom = sBottom; + this.xPanel.style.left = sLeft; + this.xPanel.style.marginTop = sMarginTop; + this.xPanel.style.marginLeft = sMarginLeft; } reduce () { // todo } Index: gc_lang/fr/webext/content_scripts/panel_tf.js ================================================================== --- gc_lang/fr/webext/content_scripts/panel_tf.js +++ gc_lang/fr/webext/content_scripts/panel_tf.js @@ -13,10 +13,11 @@ constructor (...args) { super(...args); this.xTFNode = this._createTextFormatter(); this.xPanelContent.appendChild(this.xTFNode); this.xTextArea = null; + this.xPanel.style.zIndex = 2147483647; /* maximum is 2147483647: https://stackoverflow.com/questions/491052/minimum-and-maximum-value-of-z-index */ this.TextFormatter = new TextFormatter(); this.formatText = this.TextFormatter.formatTextRuleCount; this.removeHyphenAtEndOfParagraphs = this.TextFormatter.removeHyphenAtEndOfParagraphsCount; this.mergeContiguousParagraphs = this.TextFormatter.mergeContiguousParagraphsCount;