]> source.dussan.org Git - nextcloud-server.git/commitdiff
Little trick to avoid editor loading twice on double click
authorBrice Maron <brice@bmaron.net>
Wed, 19 Oct 2011 20:42:44 +0000 (22:42 +0200)
committerBrice Maron <brice@bmaron.net>
Wed, 19 Oct 2011 20:42:44 +0000 (22:42 +0200)
apps/files_texteditor/js/editor.js

index f7b924d494dbccb22a21c7eaf25a8d9d65d0a00e..a0629aa8c4ec38ec2fa0c6febed7569000da1bd4 100644 (file)
@@ -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){