diff options
author | John Molakvoæ <skjnldsv@users.noreply.github.com> | 2019-09-16 20:15:23 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-09-16 20:15:23 +0200 |
commit | 9629015b4bef62898e38f34b5951407f941827cf (patch) | |
tree | 5ebeec8d6a5f337a52b1824857f0b7752fbdf445 | |
parent | 7149ed74c1f7aaa022d349f892c4727b614b8ec6 (diff) | |
parent | e47a7f0a95c03f14f49d13464232d87f77ac4eab (diff) | |
download | nextcloud-server-9629015b4bef62898e38f34b5951407f941827cf.tar.gz nextcloud-server-9629015b4bef62898e38f34b5951407f941827cf.zip |
Allow options to be passed to `FileList.createFile` (#12990)
Allow options to be passed to `FileList.createFile`
-rw-r--r-- | apps/files/js/filelist.js | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/apps/files/js/filelist.js b/apps/files/js/filelist.js index 7bc91e6d0e2..edb2ae2cbaf 100644 --- a/apps/files/js/filelist.js +++ b/apps/files/js/filelist.js @@ -670,7 +670,7 @@ this.$showGridView.next('#view-toggle') .removeClass('icon-toggle-filelist icon-toggle-pictures') .addClass(show ? 'icon-toggle-filelist' : 'icon-toggle-pictures') - + $('.list-container').toggleClass('view-grid', show); if (show) { // If switching into grid view from list view, too few files might be displayed @@ -2743,7 +2743,7 @@ * * @since 8.2 */ - createFile: function(name) { + createFile: function(name, options) { var self = this; var deferred = $.Deferred(); var promise = deferred.promise(); @@ -2767,7 +2767,8 @@ ) .done(function() { // TODO: error handling / conflicts - self.addAndFetchFileInfo(targetPath, '', {scrollTo: true}).then(function(status, data) { + options = _.extend({scrollTo: true}, options || {}); + self.addAndFetchFileInfo(targetPath, '', options).then(function(status, data) { deferred.resolve(status, data); }, function() { OC.Notification.show(t('files', 'Could not create file "{file}"', |