diff options
author | Vincent Petry <pvince81@owncloud.com> | 2015-09-03 12:17:35 +0200 |
---|---|---|
committer | Vincent Petry <pvince81@owncloud.com> | 2015-09-03 12:17:35 +0200 |
commit | 4ba233350746b4287556d96bb9adbae039f93882 (patch) | |
tree | 3488ba4630ced9f07d89d09a655ffdfc4ecd379b /apps/files/js | |
parent | d4104ed9f7b0b7dd497e01fe1f8558cbdb3abf00 (diff) | |
download | nextcloud-server-4ba233350746b4287556d96bb9adbae039f93882.tar.gz nextcloud-server-4ba233350746b4287556d96bb9adbae039f93882.zip |
Added unit tests for "new" file menu and small fixes
- added unit tests for NewFileMenu
- use generateUrl for FileList.createFile and FileList.createDirectory
- added unit tests for FileList.createFile and FileList.createDirectory
Diffstat (limited to 'apps/files/js')
-rw-r--r-- | apps/files/js/filelist.js | 11 | ||||
-rw-r--r-- | apps/files/js/newfilemenu.js | 1 |
2 files changed, 9 insertions, 3 deletions
diff --git a/apps/files/js/filelist.js b/apps/files/js/filelist.js index 5f55d421430..20c8e36bfa8 100644 --- a/apps/files/js/filelist.js +++ b/apps/files/js/filelist.js @@ -270,6 +270,9 @@ if (this._newFileMenu) { this._newFileMenu.remove(); } + if (this._newButton) { + this._newButton.remove(); + } // TODO: also unregister other event handlers this.fileActions.off('registerAction', this._onFileActionsUpdated); this.fileActions.off('setDefault', this._onFileActionsUpdated); @@ -1695,6 +1698,8 @@ * * @return {Promise} promise that will be resolved after the * file was created + * + * @since 8.2 */ createFile: function(name) { var self = this; @@ -1709,7 +1714,7 @@ } $.post( - OC.filePath('files', 'ajax', 'newfile.php'), + OC.generateUrl('/apps/files/ajax/newfile.php'), { dir: this.getCurrentDirectory(), filename: name @@ -1739,6 +1744,8 @@ * * @return {Promise} promise that will be resolved after the * directory was created + * + * @since 8.2 */ createDirectory: function(name) { var self = this; @@ -1753,7 +1760,7 @@ } $.post( - OC.filePath('files','ajax','newfolder.php'), + OC.generateUrl('/apps/files/ajax/newfolder.php'), { dir: this.getCurrentDirectory(), foldername: name diff --git a/apps/files/js/newfilemenu.js b/apps/files/js/newfilemenu.js index c7c02bd65f1..4c021e6b873 100644 --- a/apps/files/js/newfilemenu.js +++ b/apps/files/js/newfilemenu.js @@ -163,7 +163,6 @@ var newname = $input.val(); self._createFile(fileType, newname); $form.remove(); - $('#content').focus(); $target.find('.displayname').removeClass('hidden'); OC.hideMenus(); } |