mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-11-30 19:06:59 -05:00
Fixed #934
This commit is contained in:
parent
f7bdb7e840
commit
31c5890288
3 changed files with 5 additions and 5 deletions
|
@ -121,7 +121,7 @@ module.exports = class LevelLoader extends CocoClass
|
|||
url = "/db/level/#{obj.original}/version/#{obj.majorVersion}"
|
||||
@maybeLoadURL url, Level, 'level'
|
||||
|
||||
unless @headless
|
||||
unless @headless and not @editorMode
|
||||
wizard = ThangType.loadUniversalWizard()
|
||||
@supermodel.loadModel wizard, 'thang'
|
||||
|
||||
|
|
|
@ -64,7 +64,7 @@ module.exports = class EditorLevelView extends View
|
|||
return unless @supermodel.finished()
|
||||
@$el.find('a[data-toggle="tab"]').on 'shown.bs.tab', (e) =>
|
||||
Backbone.Mediator.publish 'level:view-switched', e
|
||||
@thangsTab = @insertSubView new ThangsTabView world: @world, supermodel: @supermodel
|
||||
@thangsTab = @insertSubView new ThangsTabView world: @world, supermodel: @supermodel, level: @level
|
||||
@settingsTab = @insertSubView new SettingsTabView supermodel: @supermodel
|
||||
@scriptsTab = @insertSubView new ScriptsTabView world: @world, supermodel: @supermodel, files: @files
|
||||
@componentsTab = @insertSubView new ComponentsTabView supermodel: @supermodel
|
||||
|
|
|
@ -35,7 +35,6 @@ module.exports = class ThangsTabView extends View
|
|||
'surface:mouse-moved': 'onSurfaceMouseMoved'
|
||||
'surface:mouse-over': 'onSurfaceMouseOver'
|
||||
'surface:mouse-out': 'onSurfaceMouseOut'
|
||||
'level-loaded': 'onLevelLoaded'
|
||||
'edit-level-thang': 'editThang'
|
||||
'level-thang-edited': 'onLevelThangEdited'
|
||||
'level-thang-done-editing': 'onLevelThangDoneEditing'
|
||||
|
@ -68,6 +67,7 @@ module.exports = class ThangsTabView extends View
|
|||
@thangTypes = @supermodel.loadCollection(new ThangTypeSearchCollection(), 'thangs').model
|
||||
# just loading all Components for now: https://github.com/codecombat/codecombat/issues/405
|
||||
@componentCollection = @supermodel.loadCollection(new ComponentsCollection(), 'components').load()
|
||||
@level = options.level
|
||||
|
||||
$(document).bind 'contextmenu', @preventDefaultContextMenu
|
||||
|
||||
|
@ -113,7 +113,7 @@ module.exports = class ThangsTabView extends View
|
|||
@$el.find('#extant-thangs-filter button:first').button('toggle')
|
||||
$(window).resize @onWindowResize
|
||||
@addThangsView = @insertSubView new AddThangsView world: @world, supermodel: @supermodel
|
||||
@onLevelLoaded() # refactor to not have this trigger when this view re-renders?
|
||||
@buildInterface() # refactor to not have this trigger when this view re-renders?
|
||||
|
||||
onFilterExtantThangs: (e) ->
|
||||
@$el.find('#extant-thangs-filter button.active').button('toggle')
|
||||
|
@ -127,7 +127,7 @@ module.exports = class ThangsTabView extends View
|
|||
@scrollTop += (if e.deltaY < 0 then 1 else -1) * 30
|
||||
e.preventDefault()
|
||||
|
||||
onLevelLoaded: (e) ->
|
||||
buildInterface: (e) ->
|
||||
@level = e.level if e
|
||||
|
||||
data = $.extend(true, {}, @level.attributes)
|
||||
|
|
Loading…
Reference in a new issue