diff --git a/filemanager/inc/class.filemanager_ui.inc.php b/filemanager/inc/class.filemanager_ui.inc.php index 1b36f4d055..c54a0443c8 100644 --- a/filemanager/inc/class.filemanager_ui.inc.php +++ b/filemanager/inc/class.filemanager_ui.inc.php @@ -138,6 +138,17 @@ class filemanager_ui 'onExecute' => 'javaScript:app.filemanager.open', 'enabled' => 'javaScript:app.filemanager.isEditable', ), + 'new' => array( + 'caption' => 'New', + 'group' => $group, + 'children' => array ( + 'document' => array ( + 'caption' => 'Document', + 'icon' => 'new', + 'onExecute' => 'javaScript:app.filemanager.editor_new', + ) + ) + ), 'saveas' => array( 'caption' => lang('Save as'), 'group' => $group, diff --git a/filemanager/js/app.js b/filemanager/js/app.js index 5db693256d..d5c0507f3d 100644 --- a/filemanager/js/app.js +++ b/filemanager/js/app.js @@ -1194,10 +1194,13 @@ app.classes.filemanager = AppJS.extend( // bind change handler for setting the selected path and calling save jQuery(vfs_select.getDOMNode()).on('change', function (){ file_path = '/webdav.php'+vfs_select.get_value(); - // Add odt extension if not exist - if (!file_path.match(/\.odt$/,'ig')) file_path += '.odt'; - widgetFilePath.set_value(file_path); - self.editor.getDocumentAsByteArray(saveByteArrayLocally); + if (vfs_select.get_value()) + { + // Add odt extension if not exist + if (!file_path.match(/\.odt$/,'ig')) file_path += '.odt'; + widgetFilePath.set_value(file_path); + self.editor.getDocumentAsByteArray(saveByteArrayLocally); + } }); // start the file selector dialog jQuery(vfs_select.getDOMNode()).click();