Skip to content

Commit

Permalink
Fix missing icons on edge handles.
Browse files Browse the repository at this point in the history
  • Loading branch information
daemontus committed Feb 23, 2021
1 parent a03f8e5 commit d736676
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 8 deletions.
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@

# --jsmin currently breaks some of our scripts so it is disabled
bundle:
inline-assets --htmlmin --cssmin --jsmin index.html index.bundle.html
inline-assets --htmlmin --cssmin index.html index.bundle.html

dev-bundle:
inline-assets index.html index.dev.bundle.html
15 changes: 10 additions & 5 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -45,16 +45,21 @@ <h3 id="edition">Edition 2019</h3>

<!-- A menu element which is shown for selected edges in the editor. -->
<div id="edge-menu" class="float-menu invisible">
<div class="button-row">
<div class="button-row">
<img src="img/visibility_off-24px.svg" id="icon-visibility-off" class="gone">
<img src="img/visibility_on-24px.svg" id="icon-visibility-on" class="gone">
<img src="img/trending_up-24px.svg" id="icon-trending-up" class="gone">
<img src="img/trending_down-24px.svg" id="icon-trending-down" class="gone">
<img src="img/swap_vert-24px.svg" id="icon-swap-vert" class="gone">
<img alt="Toggle observability (O)" id="edge-menu-observability" class="button" src="img/visibility_off-24px.svg"
src-on="img/visibility_off-24px.svg" src-off="img/visibility_on-24px.svg"
src-on="icon-visibility-off" src-off="icon-visibility-on"
alt-on="Observability off (O)" alt-off="Observability on (O)"
state=""
>
<img alt="Toggle monotonicity (M)" id="edge-menu-monotonicity" class="button" src="img/trending_up-24px.svg"
src-unspecified="img/trending_up-24px.svg" alt-unspecified="Make activating (M)"
src-activation="img/trending_down-24px.svg" alt-activation="Make inhibiting (M)"
src-inhibition="img/swap_vert-24px.svg" alt-inhibition="Monotonicity off (M)"
src-unspecified="icon-trending-up" alt-unspecified="Make activating (M)"
src-activation="icon-trending-down" alt-activation="Make inhibiting (M)"
src-inhibition="icon-swap-vert" alt-inhibition="Monotonicity off (M)"
state=""
>
<img alt="Remove (⌫)" id="edge-menu-remove" class="button" src="img/delete-24px.svg">
Expand Down
6 changes: 4 additions & 2 deletions script/UI.js
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,8 @@ let UI = {
if (state != observability.getAttribute("state")) {
observability.setAttribute("state", state);
observability.alt = observability.getAttribute("alt-"+state);
observability.src = observability.getAttribute("src-"+state);
let iconSource = observability.getAttribute("src-"+state);
observability.src = document.getElementById(iconSource).src;
// if the hint is visible, it must be showing alt of this button (because the value just changed)
hint.textContent = observability.alt;
}
Expand All @@ -431,7 +432,8 @@ let UI = {
monotonicity.updateState = function(data) {
if (monotonicity.getAttribute("state") != data.monotonicity) {
monotonicity.alt = monotonicity.getAttribute("alt-"+data.monotonicity);
monotonicity.src = monotonicity.getAttribute("src-"+data.monotonicity);
let iconSource = monotonicity.getAttribute("src-"+data.monotonicity);
monotonicity.src = document.getElementById(iconSource).src;
monotonicity.setAttribute("state", data.monotonicity);
// if the hint is visible, it must be showing alt of this button (because the value just changed)
hint.textContent = monotonicity.alt;
Expand Down

0 comments on commit d736676

Please sign in to comment.