Kind of got tab closing to work. Still need to deal with that untitled tab.

This commit is contained in:
Corey Johnson 2011-09-06 11:12:18 -07:00
parent 7fd6fafb7f
commit bb5a8cd70e

View File

@ -14,6 +14,7 @@ class Tabs extends Pane
keymap:
'Command-Ctrl-T': 'toggle'
'Command-W': 'closeActiveTab'
initialize: ->
@editor = activeWindow.document
@ -41,6 +42,16 @@ class Tabs extends Pane
"""
$('#tabs ul li:last').addClass 'active'
closeActiveTab: ->
activeTab = $('#tabs ul .active')
nextTab = activeTab.next()
nextTab = activeTab.prev() if nextTab.length == 0
console.log(nextTab)
if nextTab.length != 0
activeTab.remove()
@switchToTab nextTab.children("a")
hideTabs: ->
$('#tabs').parents('.pane').remove()
$('#tabs-style').remove()