Skip to content

Commit

Permalink
Fix editor so switching from fill to tiles and back removes all event…
Browse files Browse the repository at this point in the history
…s from all map objects
  • Loading branch information
mcmire committed Mar 31, 2012
1 parent e448dca commit 5acd2ab
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions TODO.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,5 +75,5 @@
* For map objects, group the $elem and the object together, everywhere, as one
MapObject

* BUG: When moving an object on the map, an additional mouseup event is added
and never removed.
* BUG: Switch from fill to tiles and then back, some of the map objects in the
tiles layer are still moveable.
5 changes: 3 additions & 2 deletions app/javascripts/editor/drag_object.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -218,9 +218,10 @@ define 'editor.DragObject', ->
dragObject = DragObject.create(this, options)
$this.data('dragObject', dragObject)
if typeof args[0] is 'string'
method = args.shift()
method = args[0]
if typeof dragObject[method] is 'function'
dragObject[method](args...)
console.log "calling #{method} on ##{$this.data('node-uid')}"
dragObject[method](args[1..-1])
if method is 'destroy'
$this.data('dragObject', null)
$.ender(enderMethods, true)
Expand Down

0 comments on commit 5acd2ab

Please sign in to comment.