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(
|
||||
max: @sliderIncrements
|
||||
animate: "slow"
|
||||
slide: (event, ui) => @scrubTo ui.value / @sliderIncrements
|
||||
start: (event, ui) => @clickingSlider = true
|
||||
slide: (event, ui) =>
|
||||
@scrubTo ui.value / @sliderIncrements
|
||||
@slideCount += 1
|
||||
|
||||
start: (event, ui) =>
|
||||
@slideCount = 0
|
||||
@wasPlaying = @playing
|
||||
Backbone.Mediator.publish 'level-set-playing', {playing: false}
|
||||
|
||||
stop: (event, ui) =>
|
||||
@actualProgress = ui.value / @sliderIncrements
|
||||
Backbone.Mediator.publish 'playback:manually-scrubbed', ratio: @actualProgress
|
||||
if @clickingSlider
|
||||
@clickingSlider = false
|
||||
Backbone.Mediator.publish 'level-set-playing', {playing: @wasPlaying}
|
||||
if @slideCount < 3
|
||||
@wasPlaying = false
|
||||
Backbone.Mediator.publish 'level-set-playing', {playing: false}
|
||||
@$el.find('.scrubber-handle').effect('bounce', {times: 2})
|
||||
|
|
Loading…
Reference in a new issue