Overview
Comment: | [fx] gc panel: tooltip position adjustment |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | fx | dead | gc_colors |
Files: | files | file ages | folders |
SHA3-256: |
bdcc83efc097a3bbe2db1445ae907247 |
User & Date: | olr on 2017-11-12 10:30:42 |
Other Links: | branch diff | manifest | tags |
Context
2017-11-12
| ||
10:30 | [fx] gc panel: tooltip position adjustment Closed-Leaf check-in: bdcc83efc0 user: olr tags: fx, dead, gc_colors | |
2017-11-11
| ||
22:15 | [fx] less contrast for gc colors check-in: 9623e82f75 user: olr tags: fx, gc_colors | |
Changes
Modified gc_lang/fr/webext/content_scripts/panel_gc.js from [a6cbda9c1f] to [f536efd70e].
︙ | ︙ | |||
306 307 308 309 310 311 312 | } 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 = oGrammalecte.oGCPanel.getWidth() - 330; // paragraph width - tooltip width | | | | 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 | } 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 = oGrammalecte.oGCPanel.getWidth() - 330; // paragraph width - tooltip width this.xTooltipArrow.style.top = (xNodeErr.offsetTop + 18) + "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 + 22) + "px"; this.xTooltip.style.left = (xNodeErr.offsetLeft > nLimit) ? nLimit + "px" : xNodeErr.offsetLeft + "px"; if (xNodeErr.dataset.error_type === "grammar") { // grammar error if (xNodeErr.dataset.gc_message.includes(" ##")) { let n = xNodeErr.dataset.gc_message.indexOf(" ##"); document.getElementById("grammalecte_tooltip_message").textContent = xNodeErr.dataset.gc_message.slice(0, n); document.getElementById("grammalecte_tooltip_rule_id").textContent = "Règle : " + xNodeErr.dataset.gc_message.slice(n+2); |
︙ | ︙ |