mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-04-14 05:55:00 -04:00
Added a delay to the property documentation on spell debug hover.
This commit is contained in:
parent
172242d226
commit
0cf20b577d
1 changed files with 11 additions and 2 deletions
|
@ -82,11 +82,20 @@ module.exports = class DebugView extends View
|
|||
else
|
||||
@$el.hide()
|
||||
if @variableChain?.length is 2
|
||||
Backbone.Mediator.publish 'tome:spell-debug-property-hovered', property: @variableChain[1], owner: @variableChain[0]
|
||||
clearTimeout @hoveredPropertyTimeout if @hoveredPropertyTimeout
|
||||
@hoveredPropertyTimeout = _.delay @notifyPropertyHovered, 500
|
||||
else
|
||||
Backbone.Mediator.publish 'tome:spell-debug-property-hovered', property: null
|
||||
@notifyPropertyHovered()
|
||||
@updateMarker()
|
||||
|
||||
notifyPropertyHovered: =>
|
||||
clearTimeout @hoveredPropertyTimeout if @hoveredPropertyTimeout
|
||||
@hoveredPropertyTimeout = null
|
||||
oldHoveredProperty = @hoveredProperty
|
||||
@hoveredProperty = if @variableChain?.length is 2 then owner: @variableChain[0], property: @variableChain[1] else {}
|
||||
unless _.isEqual oldHoveredProperty, @hoveredProperty
|
||||
Backbone.Mediator.publish 'tome:spell-debug-property-hovered', @hoveredProperty
|
||||
|
||||
updateMarker: ->
|
||||
if @marker
|
||||
@ace.getSession().removeMarker @marker
|
||||
|
|
Loading…
Add table
Reference in a new issue