Fixed error where saving message appears twice.

This commit is contained in:
Tom Needham 2011-11-07 22:27:49 +00:00
parent 7a8c762e48
commit 059ab889bd
1 changed files with 22 additions and 29 deletions

View File

@ -62,17 +62,8 @@ function showControls(filename){
} }
function bindControlEvents(){ function bindControlEvents(){
$("#editor_save").live('click',function() { $("#editor_save").die('click', doFileSave).live('click', doFileSave);
if(is_editor_shown){ $('#editor_close').live('click', hideFileEditor);
doFileSave();
}
});
$('#editor_close').live('click',function() {
if(is_editor_shown){
hideFileEditor();
}
});
} }
function updateSessionFileHash(path){ function updateSessionFileHash(path){
@ -175,6 +166,7 @@ function showFileEditor(dir,filename){
} }
function hideFileEditor(){ function hideFileEditor(){
if(!is_editor_shown){
$('#editor').attr('editorshown','false'); $('#editor').attr('editorshown','false');
// Fade out controls // Fade out controls
$('#editor_close').fadeOut('slow'); $('#editor_close').fadeOut('slow');
@ -193,6 +185,7 @@ function hideFileEditor(){
$('table').fadeIn('slow'); $('table').fadeIn('slow');
}); });
is_editor_shown = false; is_editor_shown = false;
}
} }
$(window).resize(function() { $(window).resize(function() {