mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-11-24 08:08:15 -05:00
Playback and level editor shortcut tweaks.
This commit is contained in:
parent
26ad981dbf
commit
91412ccd69
3 changed files with 14 additions and 18 deletions
|
@ -1,6 +1,7 @@
|
|||
.thang-avatar-wrapper(class="team-" + (thang.team || "neutral"))
|
||||
//canvas(width=100, height=100, title=thang.id + " - " + thang.team)
|
||||
img.img-responsive(src=avatarURL, title=thang.id + " - " + thang.team)
|
||||
- var title = thang.id + " - " + thang.team + (thang.type ? ' - type: "' + thang.type + '"' : '')
|
||||
img.img-responsive(src=avatarURL, title=title)
|
||||
.badge.problems
|
||||
.badge.shared-thangs
|
||||
if includeName
|
||||
|
|
|
@ -48,15 +48,10 @@ module.exports = class ThangsTabView extends View
|
|||
'click #extant-thangs-filter button': 'onFilterExtantThangs'
|
||||
|
||||
shortcuts:
|
||||
'esc': -> @selectAddThang()
|
||||
|
||||
onFilterExtantThangs: (e) ->
|
||||
button = $(e.target).closest('button')
|
||||
button.button('toggle')
|
||||
val = button.val()
|
||||
@thangsTreema.$el.removeClass(@lastHideClass) if @lastHideClass
|
||||
@thangsTreema.$el.addClass(@lastHideClass = "hide-except-#{val}") if val
|
||||
|
||||
'esc': 'selectAddThang'
|
||||
'delete, del, backspace': 'deleteSelectedExtantThang'
|
||||
'left': -> @moveAddThangSelection -1
|
||||
'right': -> @moveAddThangSelection 1
|
||||
|
||||
constructor: (options) ->
|
||||
super options
|
||||
|
@ -102,12 +97,12 @@ module.exports = class ThangsTabView extends View
|
|||
$('#thangs-list').bind 'mousewheel', @preventBodyScrollingInThangList
|
||||
@$el.find('#extant-thangs-filter button:first').button('toggle')
|
||||
|
||||
# TODO: move these into the shortcuts list
|
||||
key 'left', _.bind @moveAddThangSelection, @, -1
|
||||
key 'right', _.bind @moveAddThangSelection, @, 1
|
||||
key 'delete, del, backspace', @deleteSelectedExtantThang
|
||||
key 'f', => Backbone.Mediator.publish('level-set-debug', debug: not @surface.debug)
|
||||
key 'g', => Backbone.Mediator.publish('level-set-grid', grid: not @surface.gridShowing())
|
||||
onFilterExtantThangs: (e) ->
|
||||
button = $(e.target).closest('button')
|
||||
button.button('toggle')
|
||||
val = button.val()
|
||||
@thangsTreema.$el.removeClass(@lastHideClass) if @lastHideClass
|
||||
@thangsTreema.$el.addClass(@lastHideClass = "hide-except-#{val}") if val
|
||||
|
||||
preventBodyScrollingInThangList: (e) ->
|
||||
@scrollTop += (if e.deltaY < 0 then 1 else -1) * 30
|
||||
|
|
|
@ -36,8 +36,8 @@ module.exports = class PlaybackView extends View
|
|||
|
||||
shortcuts:
|
||||
'⌘+p, p, ctrl+p': 'onTogglePlay'
|
||||
'[': 'onScrubBack'
|
||||
']': 'onScrubForward'
|
||||
'⌘+[, ctrl+[': 'onScrubBack'
|
||||
'⌘+], ctrl+]': 'onScrubForward'
|
||||
|
||||
constructor: ->
|
||||
super(arguments...)
|
||||
|
|
Loading…
Reference in a new issue