]> source.dussan.org Git - nextcloud-server.git/commitdiff
Fixed keyboard shortcut for saving files. Thanks adlr in #ace!
authorTom Needham <needham.thomas@gmail.com>
Sun, 13 May 2012 20:19:20 +0000 (20:19 +0000)
committerTom Needham <needham.thomas@gmail.com>
Sun, 13 May 2012 20:19:20 +0000 (20:19 +0000)
apps/files_texteditor/js/editor.js

index e1e348e28ac5e6b63ccb47d674f5d55289cdcd05..9d168c1c4f6cf13d30da5dc08113b87f99bb2060 100644 (file)
@@ -221,6 +221,10 @@ function showFileEditor(dir,filename){
                                                                document.title = $('#editor').attr('data-filename')+' * - ownCloud';
                                                        }
                                                });
+                                               // Add the ctrl+s event
+                                               window.aceEditor.commands.addCommand({\r                                                 name: "save",\r                                                  bindKey: {\r                                                     win: "Ctrl-S",\r                                                 mac: "Command-S",\r                                                      sender: "editor"\r                                                       },\r                                                     exec: function(){
+                                                               doFileSave();   
+                                                       }\r                                              });
                                        });
                                } else {
                                        // Failed to get the file.