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:
Corey Johnson
2011-09-09 14:19:56 -07:00
parent 475d199052
commit bc616d05e7
3 changed files with 8 additions and 8 deletions

View File

@@ -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()

View File

@@ -1,6 +1,5 @@
<div id="tabs">
<ul class="clearfix">
<li class="active"><a href="#">untitled</a></li>
</ul>
</ul>
</div>

View File

@@ -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 ''