Merge pull request #863 from dpen2000/FixTypeError

Fix javascript error occuring when e is null/undefined
This commit is contained in:
Nick Winter 2014-04-17 11:37:51 -07:00
commit 2230b32829

View file

@ -255,7 +255,7 @@ module.exports = class ThangsTabView extends View
# @thangsTreema.deselectAll()
selectAddThang: (e) =>
return unless $(e.target).closest('.editor-level-thangs-tab-view').length
return unless e? and $(e.target).closest('.editor-level-thangs-tab-view').length
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')