Skip to content
This repository was archived by the owner on Feb 12, 2022. It is now read-only.

Commit 31c84de

Browse files
committed
Button instead of checkbox for playback
@andi-tmh complained about the buttons not being user-friendly which explains why I introduced a regular "play" button which should make it easier to click.
1 parent 7183d5f commit 31c84de

File tree

2 files changed

+23
-4
lines changed

2 files changed

+23
-4
lines changed

dist/index.html

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,23 @@
6464

6565
<div>
6666
<div class="control">
67-
Playback
68-
<input type="checkbox" id="playback" />
69-
<button id="slower" class="btn btn-default">-</button>
70-
<button id="faster" class="btn btn-default">+</button>
67+
<div style="display: none">
68+
<!-- #playback is relied on in the codebase, so I just hid it -->
69+
Playback
70+
<input type="checkbox" id="playback" />
71+
</div>
72+
<div class="btn-group" role="group" aria-label="playbackgroup">
73+
<button id="slower" class="btn btn-default">
74+
<span class="glyphicon glyphicon-minus"></span>&nbsp;
75+
</button>
76+
<button id="playbutton" class="btn btn-default">
77+
<span class="glyphicon glyphicon-play play"></span>&nbsp;
78+
<span class="glyphicon glyphicon-pause pause" style="display: none"></span>&nbsp;
79+
</button>
80+
<button id="faster" class="btn btn-default">
81+
<span class="glyphicon glyphicon-plus"></span>&nbsp;
82+
</button>
83+
</div>
7184
<button id="details" class="btn btn-default">
7285
<span class="glyphicon glyphicon-blackboard"></span>
7386
Details

lib/web.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -316,11 +316,17 @@ class Playback {
316316
jQuery('#playback').change(() => {
317317
if (jQuery('#playback')[0].checked) {
318318
this.start();
319+
jQuery('#playbutton .play').hide();
320+
jQuery('#playbutton .pause').show();
319321
} else {
320322
this.stop();
323+
jQuery('#playbutton .pause').hide();
324+
jQuery('#playbutton .play').show();
321325
}
322326
});
323327

328+
jQuery('#playbutton').click(() => jQuery('#playback').click());
329+
324330
jQuery('#details').click(() => {
325331
if (jQuery('#tabs').is(':visible')) {
326332
jQuery('#tabs').hide();

0 commit comments

Comments
 (0)