From aec6a3c32ff3195c3ccfb0484e1fb76fad4896e4 Mon Sep 17 00:00:00 2001 From: Tom Needham Date: Tue, 14 Feb 2012 21:49:51 +0000 Subject: [PATCH] Fix editing shared files and file opening bug. Fixes oc-209 and oc-195 --- apps/files_texteditor/js/editor.js | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/apps/files_texteditor/js/editor.js b/apps/files_texteditor/js/editor.js index 6e154bedb9c..2d07c4fd79d 100644 --- a/apps/files_texteditor/js/editor.js +++ b/apps/files_texteditor/js/editor.js @@ -56,18 +56,16 @@ function setSyntaxMode(ext){ function showControls(filename,writeperms){ // Loads the control bar at the top. - $('.actions,#file_action_panel').fadeOut('slow').promise().done(function() { - // Load the new toolbar. - var editorcontrols; - if(writeperms=="true"){ - var editorcontrols = '
'; - } - var html = '
'; - $('#controls').append(html); - $('#editorbar').fadeIn('slow'); - var breadcrumbhtml = ''; - $('.actions').before(breadcrumbhtml).before(editorcontrols); - }); + // Load the new toolbar. + var editorbarhtml = ''; + // Change breadcrumb classes + $('#controls .last').removeClass('last'); + $('#controls').append(editorbarhtml); + $('#editorcontrols').fadeIn('slow'); } function bindControlEvents(){ @@ -182,8 +180,10 @@ function showFileEditor(dir,filename){ // Save mtime $('#editor').attr('data-mtime', result.data.mtime); // Initialise the editor - showControls(filename,result.data.write); + $('.actions,#file_action_panel').fadeOut('slow'); $('table').fadeOut('slow', function() { + // Show the control bar + showControls(filename,result.data.write); // Update document title document.title = filename; $('#editor').text(result.data.filecontents); @@ -215,7 +215,7 @@ function showFileEditor(dir,filename){ // Fades out the editor. function hideFileEditor(){ // Fades out editor controls - $('#controls > :not(.actions,#file_access_panel,.crumb),#breadcrumb_file').fadeOut('slow',function(){ + $('#editorcontrols').fadeOut('slow',function(){ $(this).remove(); }); // Fade out editor -- 2.39.5