diff options
author | Julius Härtl <jus@bitgrid.net> | 2021-01-27 15:56:31 +0100 |
---|---|---|
committer | Julius Härtl <jus@bitgrid.net> | 2021-01-28 12:00:21 +0100 |
commit | 2d46971199eecb49b96d5031bdbad25e448d0b27 (patch) | |
tree | 95f457aba3ca0d8a6c40982434ad24e177682973 /apps/files/js | |
parent | 01113815297b6f59b7eea96dcb55db2ec374e599 (diff) | |
download | nextcloud-server-2d46971199eecb49b96d5031bdbad25e448d0b27.tar.gz nextcloud-server-2d46971199eecb49b96d5031bdbad25e448d0b27.zip |
Hide new template directory entry after creating and allow setting existing directories
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Diffstat (limited to 'apps/files/js')
-rw-r--r-- | apps/files/js/newfilemenu.js | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/apps/files/js/newfilemenu.js b/apps/files/js/newfilemenu.js index 305af051271..742a5e95fe2 100644 --- a/apps/files/js/newfilemenu.js +++ b/apps/files/js/newfilemenu.js @@ -119,6 +119,11 @@ var lastPos; var checkInput = function () { + // Special handling for the setup template directory + if ($target.attr('data-action') === 'template-init') { + return true; + } + var filename = $input.val(); try { if (!Files.isFileNameValid(filename)) { @@ -198,7 +203,21 @@ iconClass: actionSpec.iconClass, fileType: actionSpec.fileType, actionHandler: actionSpec.actionHandler, - }); + checkFilename: actionSpec.checkFilename + }); + }, + + /** + * Remove a menu item from the "New" file menu + * @param {string} actionId + */ + removeMenuEntry: function(actionId) { + var index = this._menuItems.findIndex(function (actionSpec) { + return actionSpec.id === actionId; + }); + if (index > -1) { + this._menuItems.splice(index, 1); + } }, /** |