mirror of
https://github.com/atom/atom.git
synced 2026-01-23 05:48:10 -05:00
Kind of got tab closing to work. Still need to deal with that untitled tab.
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user