From c475956484fdd36402da6fd81cc2eb25d3446e12 Mon Sep 17 00:00:00 2001 From: Tal Ben-Nun Date: Tue, 24 Mar 2020 17:21:22 +0100 Subject: [PATCH] CSS updates and avoid name clash --- diode/webclient/main.css | 7 +++++-- diode/webclient/renderer.js | 2 +- diode/webclient/sdfg_utils.js | 9 +++++++-- diode/webclient/sdfv.css | 3 ++- 4 files changed, 15 insertions(+), 6 deletions(-) diff --git a/diode/webclient/main.css b/diode/webclient/main.css index 686fcbf983..b5f7258c0f 100644 --- a/diode/webclient/main.css +++ b/diode/webclient/main.css @@ -645,14 +645,17 @@ table.diode_property_table tr:nth-child(even) { content: "playlist_play" } -.tooltip { +.sdfvtooltip { background: rgba(0, 0, 0, 0.8); color: white; font-size: 16px; font-family: "Segoe UI", Arial, sans-serif; padding: 2px 5px 2px 5px; border-radius: 4px; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; user-select: none; position: absolute; display: none; -} \ No newline at end of file +} diff --git a/diode/webclient/renderer.js b/diode/webclient/renderer.js index 64c8137516..3a101e98c7 100644 --- a/diode/webclient/renderer.js +++ b/diode/webclient/renderer.js @@ -766,7 +766,7 @@ class SDFGRenderer { // Tooltip HTML container this.tooltip_container = document.createElement('div'); this.tooltip_container.innerHTML = ''; - this.tooltip_container.className = 'tooltip'; + this.tooltip_container.className = 'sdfvtooltip'; this.tooltip_container.onmouseover = () => this.tooltip_container.style.display = "none"; this.container.appendChild(this.tooltip_container); diff --git a/diode/webclient/sdfg_utils.js b/diode/webclient/sdfg_utils.js index 7c2023ff8a..a968950c26 100644 --- a/diode/webclient/sdfg_utils.js +++ b/diode/webclient/sdfg_utils.js @@ -72,9 +72,14 @@ function sdfg_range_elem_to_string(range, settings=null) { } else { let endp1 = sdfg_property_to_string(range.end, settings) + ' + 1'; // Try to simplify using math.js + var mathjs = null; try { - endp1 = math.simplify(endp1).toString(); - } catch(e) {} + mathjs = window.math; + } catch(e) { + try { mathjs = math; } catch(e) {} + } + if (mathjs !== null) + endp1 = mathjs.simplify(endp1).toString(); preview += sdfg_property_to_string(range.start, settings) + ':' + endp1; diff --git a/diode/webclient/sdfv.css b/diode/webclient/sdfv.css index 5f4721d0eb..97df217c62 100644 --- a/diode/webclient/sdfv.css +++ b/diode/webclient/sdfv.css @@ -41,6 +41,7 @@ h1,h2,h3,h4,h5,h6{font-family:"Segoe UI",Arial,sans-serif;font-weight:400;margin -moz-user-select: none; -ms-user-select: none; user-select: none; + z-index: 999; } .context_menu_option { @@ -62,7 +63,7 @@ h1,h2,h3,h4,h5,h6{font-family:"Segoe UI",Arial,sans-serif;font-weight:400;margin width: 0; } -.tooltip { +.sdfvtooltip { background: rgba(0, 0, 0, 0.8); color: white; font-size: 16px;