summaryrefslogtreecommitdiffstats
path: root/apps/files/js
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2015-09-03 12:17:35 +0200
committerVincent Petry <pvince81@owncloud.com>2015-09-03 12:17:35 +0200
commit4ba233350746b4287556d96bb9adbae039f93882 (patch)
tree3488ba4630ced9f07d89d09a655ffdfc4ecd379b /apps/files/js
parentd4104ed9f7b0b7dd497e01fe1f8558cbdb3abf00 (diff)
downloadnextcloud-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.js11
-rw-r--r--apps/files/js/newfilemenu.js1
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();
}