mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-11-28 10:06:08 -05:00
Tweaks to the scrubber. Sliding it around no longer changes its play state; it only pauses playback if you click.
This commit is contained in:
parent
296a7584a6
commit
c663bd74cf
1 changed files with 11 additions and 4 deletions
|
@ -165,13 +165,20 @@ module.exports = class PlaybackView extends View
|
||||||
$('.scrubber .progress', @$el).slider(
|
$('.scrubber .progress', @$el).slider(
|
||||||
max: @sliderIncrements
|
max: @sliderIncrements
|
||||||
animate: "slow"
|
animate: "slow"
|
||||||
slide: (event, ui) => @scrubTo ui.value / @sliderIncrements
|
slide: (event, ui) =>
|
||||||
start: (event, ui) => @clickingSlider = true
|
@scrubTo ui.value / @sliderIncrements
|
||||||
|
@slideCount += 1
|
||||||
|
|
||||||
|
start: (event, ui) =>
|
||||||
|
@slideCount = 0
|
||||||
|
@wasPlaying = @playing
|
||||||
|
Backbone.Mediator.publish 'level-set-playing', {playing: false}
|
||||||
|
|
||||||
stop: (event, ui) =>
|
stop: (event, ui) =>
|
||||||
@actualProgress = ui.value / @sliderIncrements
|
@actualProgress = ui.value / @sliderIncrements
|
||||||
Backbone.Mediator.publish 'playback:manually-scrubbed', ratio: @actualProgress
|
Backbone.Mediator.publish 'playback:manually-scrubbed', ratio: @actualProgress
|
||||||
if @clickingSlider
|
Backbone.Mediator.publish 'level-set-playing', {playing: @wasPlaying}
|
||||||
@clickingSlider = false
|
if @slideCount < 3
|
||||||
@wasPlaying = false
|
@wasPlaying = false
|
||||||
Backbone.Mediator.publish 'level-set-playing', {playing: false}
|
Backbone.Mediator.publish 'level-set-playing', {playing: false}
|
||||||
@$el.find('.scrubber-handle').effect('bounce', {times: 2})
|
@$el.find('.scrubber-handle').effect('bounce', {times: 2})
|
||||||
|
|
Loading…
Reference in a new issue