mirror of
https://github.com/atom/atom.git
synced 2026-01-23 05:48:10 -05:00
Got rid of the untitled tab.
It still gives you an empty editor document. I'd like to get rid of this too and maybe show a "recently opened" window.
This commit is contained in:
@@ -47,7 +47,7 @@ class Tabs extends Pane
|
||||
|
||||
name = _.last path.split '/'
|
||||
$('#tabs ul .active').removeClass()
|
||||
$('#tabs ul li:last').after """
|
||||
$('#tabs ul').append """
|
||||
<li data-path='#{path}'><a href='#'>#{name}</a></li>
|
||||
"""
|
||||
$('#tabs ul li:last').addClass 'active'
|
||||
@@ -57,10 +57,9 @@ class Tabs extends Pane
|
||||
nextTab = activeTab.next()
|
||||
nextTab = activeTab.prev() if nextTab.length == 0
|
||||
|
||||
if nextTab.length != 0
|
||||
@editor.deleteSession activeTab.data 'path'
|
||||
activeTab.remove()
|
||||
@switchToTab nextTab
|
||||
@editor.deleteSession activeTab.data 'path'
|
||||
activeTab.remove()
|
||||
@switchToTab nextTab if nextTab.length != 0
|
||||
|
||||
hideTabs: ->
|
||||
$('#tabs').parents('.pane').remove()
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
<div id="tabs">
|
||||
<ul class="clearfix">
|
||||
<li class="active"><a href="#">untitled</a></li>
|
||||
</ul>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -100,8 +100,10 @@ class Editor extends Pane
|
||||
@ace.setSession @sessions[path]
|
||||
|
||||
deleteSession: (path) ->
|
||||
@filename = null if path is @filename
|
||||
if path is @filename
|
||||
@filename = null
|
||||
delete @sessions[path]
|
||||
@ace.setSession @newSession()
|
||||
|
||||
newSession: (code) ->
|
||||
doc = new EditSession code or ''
|
||||
|
||||
Reference in New Issue
Block a user