   onSpriteMouseDown: (e) ->
     # Sprite clicks happen after stage clicks, but we need to know whether a sprite is being clicked.
     clearTimeout @backgroundAddClickTimeout
+    if e.originalEvent.nativeEvent.button == 2
+      @onSpriteContextMenu e
 
   onStageMouseDown: (e) ->
     if @addThangSprite
       # If we click on the background, we need to add @addThangSprite, but not if onSpriteMouseDown will fire.
       @backgroundAddClickTimeout = _.defer => @onExtantThangSelected {}
+    $('#contextmenu').hide()
 
   onSpriteDragged: (e) ->
     return unless @selectedExtantThang and e.thang?.id is @selectedExtantThang?.id

  "physics.Physical"          : "524b75ad7fc0f6d519000001"

class ThangTypeSearchCollection extends CocoCollection
  url: '/db/thang.type/search?project=true'
  model: ThangType

module.exports = class ThangsTabView extends View


  # TODO: figure out a good way to have all Surface clicks and Treema clicks just proxy in one direction, so we can maintain only one way of handling selection and deletion
  onExtantThangSelected: (e) ->
    @selectedExtantSprite?.setNameLabel? null unless @selectedExtantSprite is e.sprite
    @selectedExtantThang = e.thang
    @selectedExtantSprite = e.sprite
    if e.thang and (key.alt or key.meta)
