Propagate the event, but only handle it once in

the project plugin pane
This commit is contained in:
Corey Johnson
2011-09-26 09:56:03 -07:00
parent 1b4f371873
commit 46d68cd934

View File

@@ -18,6 +18,8 @@ class ProjectPane extends Pane
@reload()
$('#project li').live 'click', (event) =>
return true if event.__projectClicked__
$('#project .active').removeClass 'active'
el = $(event.currentTarget)
path = decodeURIComponent el.attr 'path'
@@ -37,8 +39,13 @@ class ProjectPane extends Pane
else
el.addClass 'active'
@window.open path
false # Don't bubble!
# HACK I need the event to propogate beyond the project pane,
# but I need the project pane to ignore it. Need somehting
# cleaner here.
event.__projectClicked__ = true
true
reload: ->
@html.children('#project .cwd').text _.last @window.path.split '/'