summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrice Maron <brice@bmaron.net>2011-10-19 22:42:44 +0200
committerBrice Maron <brice@bmaron.net>2011-10-19 22:42:44 +0200
commit7e344527461194cc2cee9085648bfbd450ef1f7f (patch)
treeb916b2e7e67cda24cc886953b926fb68a004029d
parentda8d32ae38acdab576a30ca56b30579f427c780d (diff)
downloadnextcloud-server-7e344527461194cc2cee9085648bfbd450ef1f7f.tar.gz
nextcloud-server-7e344527461194cc2cee9085648bfbd450ef1f7f.zip
Little trick to avoid editor loading twice on double click
-rw-r--r--apps/files_texteditor/js/editor.js10
1 files changed, 4 insertions, 6 deletions
diff --git a/apps/files_texteditor/js/editor.js b/apps/files_texteditor/js/editor.js
index f7b924d494d..a0629aa8c4e 100644
--- a/apps/files_texteditor/js/editor.js
+++ b/apps/files_texteditor/js/editor.js
@@ -73,11 +73,7 @@ function bindControlEvents(){
function editorIsShown(){
// Not working as intended. Always returns true.
- if(window.aceEditor){
- return true;
- } else {
- return false;
- }
+ return is_editor_shown;
}
function updateSessionFileHash(path){
@@ -174,6 +170,7 @@ function showFileEditor(dir,filename){
}
// End ajax
});
+ is_editor_shown = true;
}
}
@@ -194,12 +191,13 @@ function hideFileEditor(){
$('.actions,#file_access_panel').fadeIn('slow');
$('table').fadeIn('slow');
});
+ is_editor_shown = false;
}
$(window).resize(function() {
setEditorSize();
});
-
+var is_editor_shown = false;
$(document).ready(function(){
if(typeof FileActions!=='undefined'){
FileActions.register('text','Edit','',function(filename){