diff options
author | Vincent Petry <pvince81@owncloud.com> | 2015-11-19 16:39:41 +0300 |
---|---|---|
committer | Vincent Petry <pvince81@owncloud.com> | 2015-11-19 17:36:21 +0300 |
commit | 8fc0e05564195878c5ee2195ae54cd59058fe414 (patch) | |
tree | 67555e1e81a2d30579c3dcaaff2585ce01d710c8 /apps/files/js/newfilemenu.js | |
parent | 58eaeb267c60ed2aed4b5592a28d16f5453bb773 (diff) |
Remove "Text file" entry in the "+" menu
The text editor app will register this instead.
Also made "fileList" a non-private attribute to make it possible for
plugins to access the attached file list object.
Diffstat (limited to 'apps/files/js/newfilemenu.js')
-rw-r--r-- | apps/files/js/newfilemenu.js | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/apps/files/js/newfilemenu.js b/apps/files/js/newfilemenu.js index 175eb1d1a75..be7dcc40b6e 100644 --- a/apps/files/js/newfilemenu.js +++ b/apps/files/js/newfilemenu.js @@ -44,6 +44,11 @@ 'click .menuitem': '_onClickAction' }, + /** + * @type OCA.Files.FileList + */ + fileList: null, + initialize: function(options) { var self = this; var $uploadEl = $('#file_upload_start'); @@ -55,25 +60,16 @@ console.warn('Missing upload element "file_upload_start"'); } - this._fileList = options && options.fileList; + this.fileList = options && options.fileList; this._menuItems = [{ - id: 'file', - displayName: t('files', 'Text file'), - templateName: t('files', 'New text file.txt'), - iconClass: 'icon-filetype-text', - fileType: 'file', - actionHandler: function(name) { - self._fileList.createFile(name); - } - }, { id: 'folder', displayName: t('files', 'Folder'), templateName: t('files', 'New folder'), iconClass: 'icon-folder', fileType: 'folder', actionHandler: function(name) { - self._fileList.createDirectory(name); + self.fileList.createDirectory(name); } }]; @@ -149,7 +145,7 @@ try { if (!Files.isFileNameValid(filename)) { // Files.isFileNameValid(filename) throws an exception itself - } else if (self._fileList.inList(filename)) { + } else if (self.fileList.inList(filename)) { throw t('files', '{newname} already exists', {newname: filename}); } else { return true; |