Index: gc_lang/fr/webext/content_scripts/menu.css ================================================================== --- gc_lang/fr/webext/content_scripts/menu.css +++ gc_lang/fr/webext/content_scripts/menu.css @@ -61,10 +61,26 @@ box-shadow: 0px 0px 2px hsla(210, 10%, 10%, .5); background-color: hsl(210, 50%, 30%); font-family: "Trebuchet MS", "Fira Sans", "Liberation Sans", sans-serif; z-index: 2147483640; /* maximum is 2147483647: https://stackoverflow.com/questions/491052/minimum-and-maximum-value-of-z-index */ } + +.grammalecte_menu_close_button { + float: right; + margin: 2px 2px 0 0; + padding: 1px 5px; + border-radius: 2px; + background-color: hsl(0, 50%, 50%); + color: hsl(0, 20%, 90%); + font-size: 12px; + font-weight: bold; + cursor: pointer; +} +.grammalecte_menu_close_button:hover { + background-color: hsl(0, 60%, 50%); + color: hsl(0, 30%, 96%); +} .grammalecte_menu_item { padding: 3px 10px; background-color: hsl(210, 50%, 40%); font-size: 14px; 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 @@ -21,10 +21,13 @@ _createMenu (xNode) { try { let sText = (xNode.tagName == "TEXTAREA") ? xNode.value : xNode.textContent; let xMenu = oGrammalecte.createNode("div", {id: this.sMenuId, className: "grammalecte_menu"}); + let xCloseButton = oGrammalecte.createNode("div", {className: "grammalecte_menu_close_button", textContent: "×"} ); + xCloseButton.onclick = () => { this.switchMenu(); } + xMenu.appendChild(xCloseButton); xMenu.appendChild(oGrammalecte.createNode("div", {className: "grammalecte_menu_header", textContent: "GRAMMALECTE"})); // Text formatter if (xNode.tagName == "TEXTAREA") { let xTFButton = oGrammalecte.createNode("div", {className: "grammalecte_menu_item", textContent: "Formateur de texte"}); xTFButton.onclick = () => {