mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-02-17 08:50:58 -05:00
Fixed the level and component watch buttons.
This commit is contained in:
parent
8f4535853b
commit
9eff958dcb
5 changed files with 12 additions and 12 deletions
|
@ -19,8 +19,8 @@ nav.navbar.navbar-default(role='navigation')
|
|||
|
||||
ul.dropdown-menu
|
||||
li.dropdown-header Actions
|
||||
li#watch-component-button
|
||||
a
|
||||
li
|
||||
a#component-watch-button
|
||||
span.watch
|
||||
span.glyphicon.glyphicon-eye-open
|
||||
span.spl Watch
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
extends /templates/base
|
||||
|
||||
block header
|
||||
if false
|
||||
if level.loading
|
||||
nav.navbar.navbar-default(role='navigation')#level-editor-top-nav
|
||||
.container-fluid
|
||||
ul.nav.navbar-nav
|
||||
|
@ -55,8 +55,8 @@ block header
|
|||
span.glyphicon-chevron-down.glyphicon
|
||||
ul.dropdown-menu
|
||||
li.dropdown-header Actions
|
||||
li#watch-button
|
||||
a
|
||||
li
|
||||
a#level-watch-button
|
||||
span.watch
|
||||
span.glyphicon.glyphicon-eye-open
|
||||
span.spl Watch
|
||||
|
|
|
@ -14,7 +14,7 @@ nav.navbar.navbar-default(role='navigation')
|
|||
span.glyphicon-chevron-down.glyphicon
|
||||
ul.dropdown-menu
|
||||
li.dropdown-header Actions
|
||||
li#watch-component-button
|
||||
li#component-watch-button
|
||||
a
|
||||
span.watch
|
||||
span.glyphicon.glyphicon-eye-open
|
||||
|
|
|
@ -16,7 +16,7 @@ module.exports = class LevelComponentEditView extends View
|
|||
'click .nav a': (e) -> $(e.target).tab('show')
|
||||
'click #component-patches-tab': -> @patchesView.load()
|
||||
'click #patch-component-button': 'startPatchingComponent'
|
||||
'click #watch-component-button': 'toggleWatchComponent'
|
||||
'click #component-watch-button': 'toggleWatchComponent'
|
||||
|
||||
constructor: (options) ->
|
||||
super options
|
||||
|
@ -35,7 +35,7 @@ module.exports = class LevelComponentEditView extends View
|
|||
@buildConfigSchemaTreema()
|
||||
@buildCodeEditor()
|
||||
@patchesView = @insertSubView(new PatchesView(@levelComponent), @$el.find('.patches-view'))
|
||||
@$el.find('#watch-component-button').find('> span').toggleClass('secret') if @levelComponent.watching()
|
||||
@$el.find('#component-watch-button').find('> span').toggleClass('secret') if @levelComponent.watching()
|
||||
|
||||
buildSettingsTreema: ->
|
||||
data = _.pick @levelComponent.attributes, (value, key) => key in @editableSettings
|
||||
|
@ -105,7 +105,7 @@ module.exports = class LevelComponentEditView extends View
|
|||
Backbone.Mediator.publish 'level:view-switched', e
|
||||
|
||||
toggleWatchComponent: ->
|
||||
button = @$el.find('#watch-component-button')
|
||||
button = @$el.find('#component-watch-button')
|
||||
@levelComponent.watch(button.find('.watch').is(':visible'))
|
||||
button.find('> span').toggleClass('secret')
|
||||
|
||||
|
|
|
@ -30,7 +30,7 @@ module.exports = class EditorLevelView extends View
|
|||
'click #level-history-button': 'showVersionHistory'
|
||||
'click #patches-tab': -> @patchesView.load()
|
||||
'click #commit-level-patch-button': 'startPatchingLevel'
|
||||
'click #watch-button': 'toggleWatchLevel'
|
||||
'click #level-watch-button': 'toggleWatchLevel'
|
||||
|
||||
constructor: (options, @levelID) ->
|
||||
super options
|
||||
|
@ -94,7 +94,7 @@ module.exports = class EditorLevelView extends View
|
|||
Backbone.Mediator.publish 'level-loaded', level: @level
|
||||
@showReadOnly() if me.get('anonymous')
|
||||
@patchesView = @insertSubView(new PatchesView(@level), @$el.find('.patches-view'))
|
||||
@$el.find('#watch-button').find('> span').toggleClass('secret') if @level.watching()
|
||||
@$el.find('#level-watch-button').find('> span').toggleClass('secret') if @level.watching()
|
||||
|
||||
onPlayLevel: (e) ->
|
||||
sendLevel = =>
|
||||
|
@ -128,6 +128,6 @@ module.exports = class EditorLevelView extends View
|
|||
Backbone.Mediator.publish 'level:view-switched', e
|
||||
|
||||
toggleWatchLevel: ->
|
||||
button = @$el.find('#watch-button')
|
||||
button = @$el.find('#level-watch-button')
|
||||
@level.watch(button.find('.watch').is(':visible'))
|
||||
button.find('> span').toggleClass('secret')
|
||||
|
|
Loading…
Reference in a new issue