mirror of
https://github.com/pulsar-edit/pulsar.git
synced 2024-09-11 11:15:24 +03:00
Kind of got tab closing to work. Still need to deal with that untitled tab.
This commit is contained in:
parent
7fd6fafb7f
commit
bb5a8cd70e
@ -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()
|
||||
|
Loading…
Reference in New Issue
Block a user