mirror of
https://github.com/Codiad/Codiad.git
synced 2026-03-22 17:06:50 +01:00
Set the new active tab when closing a file.
This commit is contained in:
@@ -111,7 +111,7 @@
|
||||
.live('click', function(e) {
|
||||
e.stopPropagation();
|
||||
_this.remove($(this)
|
||||
.parent('a')
|
||||
.parent('li')
|
||||
.attr('data-path'));
|
||||
});
|
||||
|
||||
@@ -227,10 +227,10 @@
|
||||
.append(thumb));
|
||||
$.get(this.controller + '?action=add&path=' + path);
|
||||
|
||||
var tabThumb = $('<li class="tab-item"><a class="content" title="'+path+'" data-path="'+path+'">' + path.substring(1) + '</a><a class="close">x</a></li>');
|
||||
var tabThumb = $('<li class="tab-item" data-path="'+path+'"><a class="content" title="'+path+'">' + path.substring(1) + '</a><a class="close">x</a></li>');
|
||||
$('.tab-list')
|
||||
.append(tabThumb);
|
||||
session.tabThumb = tabThumb;
|
||||
session.tabThumb = tabThumb;
|
||||
|
||||
this.focus(path);
|
||||
// Mark draft as changed
|
||||
@@ -323,6 +323,9 @@
|
||||
} else {
|
||||
$(nextThumb[0])
|
||||
.addClass('active');
|
||||
// TODO : Change this when finilizing tabs.
|
||||
$($('.tab-list li[data-path]')[0])
|
||||
.addClass('active');
|
||||
var nextPath = nextThumb.attr('data-path');
|
||||
var nextSession = this.sessions[nextPath];
|
||||
codiad.editor.removeSession(session, nextSession);
|
||||
|
||||
Reference in New Issue
Block a user