From e0dde083d0502a4a5374feb51ea38ceaeebf7c3b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20Molakvo=C3=A6=20=28skjnldsv=29?= Date: Tue, 23 Oct 2018 08:43:02 +0200 Subject: [PATCH] Public fixes, request & default to grid MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: John Molakvoæ (skjnldsv) --- apps/files/js/filelist.js | 9 ++++++--- apps/files_sharing/lib/Controller/ShareController.php | 1 + 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/apps/files/js/filelist.js b/apps/files/js/filelist.js index 6c86286d568..1f4d230cef0 100644 --- a/apps/files/js/filelist.js +++ b/apps/files/js/filelist.js @@ -599,9 +599,12 @@ */ _onGridviewChange: function() { var show = this.$showGridView.is(':checked'); - $.post(OC.generateUrl('/apps/files/api/v1/showgridview'), { - show: show - }); + // only save state if user is logged in + if (OC.currentUser) { + $.post(OC.generateUrl('/apps/files/api/v1/showgridview'), { + show: show + }); + } this.$showGridView.next('#view-toggle') .removeClass('icon-toggle-filelist icon-toggle-pictures') .addClass(show ? 'icon-toggle-filelist' : 'icon-toggle-pictures') diff --git a/apps/files_sharing/lib/Controller/ShareController.php b/apps/files_sharing/lib/Controller/ShareController.php index 8e9cc5a9636..8d02cc82fd2 100644 --- a/apps/files_sharing/lib/Controller/ShareController.php +++ b/apps/files_sharing/lib/Controller/ShareController.php @@ -338,6 +338,7 @@ class ShareController extends AuthPublicShareController { $folder->assign('isPublic', true); $folder->assign('hideFileList', $hideFileList); $folder->assign('publicUploadEnabled', 'no'); + $folder->assign('showgridview', true); $folder->assign('uploadMaxFilesize', $maxUploadFilesize); $folder->assign('uploadMaxHumanFilesize', \OCP\Util::humanFileSize($maxUploadFilesize)); $folder->assign('freeSpace', $freeSpace);