Skip to content

Commit

Permalink
Use bootstrap switch for annotation toggle
Browse files Browse the repository at this point in the history
Also removed unwanted string concatenation artifacts
  • Loading branch information
Splines committed Nov 13, 2023
1 parent 327f724 commit 8b83c5a
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 11 deletions.
2 changes: 1 addition & 1 deletion app/assets/javascripts/thyme/annotations/annotation.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class Annotation {
stroke:${strokeColor};
stroke-width:${strokeWidth};
fill-rule:evenodd;"/>
</svg>' +
</svg>
</span>`;
$('#' + thymeAttributes.markerBarId).append(markerStr);

Expand Down
6 changes: 2 additions & 4 deletions app/assets/stylesheets/annotations.scss
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,8 @@
position: absolute;
display: flex;
left: 89%;
top: 40%;
transform: translateY(-50%);
input:checked + .slider {
background-color: #2196F3;
input:checked {
background-color: #2196F3; // TODO: outsource common video control colors
}
}

Expand Down
1 change: 0 additions & 1 deletion app/assets/stylesheets/thyme.scss
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
}

#hypervideo-container {
font-size: 0;
position: relative;
background: white;
margin: 0;
Expand Down
12 changes: 7 additions & 5 deletions app/views/media/play.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
<option value="2">2x</option>
</select>
</div>

<!--- ANNOTATION BUTTON -->
<% if user_signed_in? %>
<div id="annotation-button">
Expand All @@ -69,13 +70,14 @@
</i>
</div>
<% end %>

<!--- TOGGLE FOR TURNING ON/OFF VISIBLE ANNOTATIONS -->
<div id="annotations-toggle" style="display: none;">
<label class="switch">
<input id="annotations-toggle-check" type="checkbox" checked="true">
<span class="slider round"></span>
</label>
<div id="annotations-toggle" class="form-check form-switch"
style="display: none;">
<input id="annotations-toggle-check"
class="form-check-input" type="checkbox" role="switch" checked>
</div>

<div id="size-buttons">
<i id="ia-active" class="material-icons clickable"
data-status="true">
Expand Down

0 comments on commit 8b83c5a

Please sign in to comment.