mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-03-14 07:00:01 -04:00
Fixed #1038. Focus should now remain on code editor when after clicking on Surface.
This commit is contained in:
parent
1094d09aa5
commit
f79a2848fd
6 changed files with 6 additions and 3 deletions
|
@ -53,6 +53,7 @@ module.exports = class CoordinateDisplay extends createjs.Container
|
|||
wop = @camera.screenToWorld x: e.x, y: e.y
|
||||
wop.x = Math.round wop.x
|
||||
wop.y = Math.round wop.y
|
||||
Backbone.Mediator.publish 'tome:focus-editor', {}
|
||||
Backbone.Mediator.publish 'surface:coordinate-selected', wop
|
||||
|
||||
onZoomUpdated: (e) ->
|
||||
|
|
|
@ -483,11 +483,13 @@ module.exports = Surface = class Surface extends CocoClass
|
|||
worldPos = @camera.screenToWorld x: e.stageX, y: e.stageY
|
||||
event = onBackground: onBackground, x: e.stageX, y: e.stageY, originalEvent: e, worldPos: worldPos
|
||||
Backbone.Mediator.publish 'surface:stage-mouse-down', event
|
||||
Backbone.Mediator.publish 'tome:focus-editor', {}
|
||||
|
||||
onMouseUp: (e) =>
|
||||
return if @disabled
|
||||
onBackground = not @stage.hitTest e.stageX, e.stageY
|
||||
Backbone.Mediator.publish 'surface:stage-mouse-up', onBackground: onBackground, x: e.stageX, y: e.stageY, originalEvent: e
|
||||
Backbone.Mediator.publish 'tome:focus-editor', {}
|
||||
|
||||
onMouseWheel: (e) =>
|
||||
# https://github.com/brandonaaron/jquery-mousewheel
|
||||
|
|
|
@ -23,5 +23,5 @@ module.exports =
|
|||
bus: {$ref: 'bus'}
|
||||
|
||||
'bus:player-states-changed': c.object {title: 'Player state changes', description: 'State of the players has changed'},
|
||||
states: c.array {}, {type: 'object'}
|
||||
states: {type: 'object', additionalProperties: {type: 'object'}}
|
||||
bus: {$ref: 'bus'}
|
||||
|
|
|
@ -66,6 +66,7 @@ module.exports = # /app/lib/surface
|
|||
'surface:coordinate-selected': c.object {required: ['x', 'y']},
|
||||
x: {type: 'number'}
|
||||
y: {type: 'number'}
|
||||
z: {type: 'number'}
|
||||
|
||||
'surface:coordinates-shown': c.object {}
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@ module.exports = class LevelSearchView extends SearchView
|
|||
model: require 'models/Level'
|
||||
modelURL: '/db/level'
|
||||
tableTemplate: require 'templates/editor/level/table'
|
||||
page: 'editor'
|
||||
page: 'level'
|
||||
|
||||
getRenderData: ->
|
||||
context = super()
|
||||
|
|
|
@ -221,7 +221,6 @@ module.exports = class SpectateLevelView extends RootView
|
|||
else
|
||||
console.log 'World scripts don\'t exist!'
|
||||
nonVictoryPlaybackScripts = []
|
||||
console.log nonVictoryPlaybackScripts
|
||||
@scriptManager = new ScriptManager({scripts: nonVictoryPlaybackScripts, view:@, session: @session})
|
||||
@scriptManager.loadFromSession()
|
||||
|
||||
|
|
Loading…
Reference in a new issue