Fixes issue with esc key not deselecting the current thang

This commit is contained in:
Jayant Jain 2014-05-24 03:44:46 +05:30
parent 94f70ca9f4
commit cbe5f3a011

View file

@ -250,7 +250,7 @@ module.exports = class ThangsTabView extends View
# @thangsTreema.deselectAll()
selectAddThang: (e) =>
return unless e? and $(e.target).closest('#editor-level-thangs-tab-view').length
return unless e? and $(e.target).closest('#editor-level-thangs-tab-view').length or key.isPressed('esc')
if e then target = $(e.target) else target = @$el.find('.add-thangs-palette') # pretend to click on background if no event
return true if target.attr('id') is 'surface'
target = target.closest('.add-thang-palette-icon')