Grammalecte  Check-in [22c8e20f5f]

Overview
Comment:[fx] tooltip arrow position adjustment
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | fx | kill_innerHTML
Files: files | file ages | folders
SHA3-256: 22c8e20f5f7993784083de61101d74467e021d349eb923fc668a069d9f033cf5
User & Date: olr on 2017-07-18 10:38:41
Other Links: branch diff | manifest | tags
Context
2017-07-18
11:47
[fx] display rule id in debug mode Closed-Leaf check-in: 5da1befa07 user: olr tags: fx, kill_innerHTML
10:38
[fx] tooltip arrow position adjustment check-in: 22c8e20f5f user: olr tags: fx, kill_innerHTML
09:31
[fx] arrow for tooltips check-in: 018b49d9ba user: olr tags: fx, kill_innerHTML
Changes

Modified gc_lang/fr/xpi/data/gc_panel.js from [717ac8a586] to [7ec8fbbdd9].

297
298
299
300
301
302
303
304

305
306
307
308
309
310
311
297
298
299
300
301
302
303

304
305
306
307
308
309
310
311







-
+







        hideAllTooltips();
        let xNodeErr = document.getElementById(sNodeErrorId);
        let sTooltipId = (xNodeErr.dataset.error_type === "grammar") ? "gc_tooltip" : "sc_tooltip";
        let xNodeTooltip = document.getElementById(sTooltipId);
        let xNodeTooltipArrow = document.getElementById(sTooltipId+"_arrow"); 
        let nLimit = nPanelWidth - 330; // paragraph width - tooltip width
        xNodeTooltipArrow.style.top = (xNodeErr.offsetTop + 16) + "px"
        xNodeTooltipArrow.style.left = (xNodeErr.offsetLeft + Math.floor(xNodeErr.offsetWidth / 2)) + "px"
        xNodeTooltipArrow.style.left = (xNodeErr.offsetLeft + Math.floor((xNodeErr.offsetWidth / 2))-4) + "px" // 4 is half the width of the arrow.
        xNodeTooltip.style.top = (xNodeErr.offsetTop + 20) + "px";
        xNodeTooltip.style.left = (xNodeErr.offsetLeft > nLimit) ? nLimit + "px" : xNodeErr.offsetLeft + "px";
        if (xNodeErr.dataset.error_type === "grammar") {
            // grammar error
            document.getElementById("gc_message").textContent = xNodeErr.dataset.gc_message;
            if (xNodeErr.dataset.gc_url != "") {
                document.getElementById("gc_url").style.display = "inline";