more natural cmd-w for the tabs pane again

This commit is contained in:
Chris Wanstrath
2011-11-13 20:07:14 -08:00
parent dc3d7f5423
commit b2070a2693

View File

@@ -50,8 +50,17 @@ class TabsPane extends Pane
$("#tabs ul li:last").addClass 'active'
closeActiveTab: ->
@removeTab $('#tabs ul .active').data 'path'
@prevTab()
tabsLength = $('#tabs ul li').length
activePath = $('#tabs ul .active').data 'path'
if tabsLength is 1
@removeTab activePath
$('#main-container').children().css 'display', 'none !important'
else if tabsLength > 0
@removeTab activePath
@prevTab()
else
window.close()
removeTab: (path) ->
tab = $("#tabs li[data-path='#{path}']")