From bb5a8cd70e2bb66d25500c7bcf007715ad72a310 Mon Sep 17 00:00:00 2001 From: Corey Johnson Date: Tue, 6 Sep 2011 11:12:18 -0700 Subject: [PATCH] Kind of got tab closing to work. Still need to deal with that untitled tab. --- plugins/tabs/tabs.coffee | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/plugins/tabs/tabs.coffee b/plugins/tabs/tabs.coffee index 8a93ecb3c..3e2133847 100644 --- a/plugins/tabs/tabs.coffee +++ b/plugins/tabs/tabs.coffee @@ -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()