Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPytal <24800714+Pytal@users.noreply.github.com>2022-07-05 20:46:32 +0300
committerGitHub <noreply@github.com>2022-07-05 20:46:32 +0300
commit8b23c1c6772afdd4a1709bdb85cf3b88c5b5a6a5 (patch)
tree69831365536156708e3965d88265308778e0045b
parentde3504150c44af8b20bc7fad9810abc3be0b9839 (diff)
parentf5236cde1a2b9ec87794768568155344fa3a4461 (diff)
Merge pull request #33107 from nextcloud/enh/a11y-dynamic-grid-toggle-tooltip
-rw-r--r--apps/files/js/filelist.js14
-rw-r--r--apps/files/templates/index.php2
-rw-r--r--apps/files_sharing/templates/public.php6
3 files changed, 13 insertions, 9 deletions
diff --git a/apps/files/js/filelist.js b/apps/files/js/filelist.js
index 714e66e53ed..19b746ec847 100644
--- a/apps/files/js/filelist.js
+++ b/apps/files/js/filelist.js
@@ -748,19 +748,23 @@
* @returns {undefined}
*/
_onGridviewChange: function() {
- var show = this.$showGridView.is(':checked');
+ const isGridView = this.$showGridView.is(':checked');
// only save state if user is logged in
if (OC.currentUser) {
$.post(OC.generateUrl('/apps/files/api/v1/showgridview'), {
- show: show
+ show: isGridView,
});
}
this.$showGridView.next('#view-toggle')
.removeClass('icon-toggle-filelist icon-toggle-pictures')
- .addClass(show ? 'icon-toggle-filelist' : 'icon-toggle-pictures')
+ .addClass(isGridView ? 'icon-toggle-filelist' : 'icon-toggle-pictures')
+ this.$showGridView.next('#view-toggle').attr(
+ 'data-original-title',
+ isGridView ? t('files', 'Show list view') : t('files', 'Show grid view'),
+ )
- $('.list-container').toggleClass('view-grid', show);
- if (show) {
+ $('.list-container').toggleClass('view-grid', isGridView);
+ if (isGridView) {
// If switching into grid view from list view, too few files might be displayed
// Try rendering the next page
this._onScroll();
diff --git a/apps/files/templates/index.php b/apps/files/templates/index.php
index 0d95f2694d9..e12d9fafab3 100644
--- a/apps/files/templates/index.php
+++ b/apps/files/templates/index.php
@@ -6,7 +6,7 @@
aria-label="<?php p($l->t('Toggle grid view'))?>"
<?php if ($_['showgridview']) { ?>checked="checked" <?php } ?>/>
<label id="view-toggle" for="showgridview" tabindex="0" class="button <?php p($_['showgridview'] ? 'icon-toggle-filelist' : 'icon-toggle-pictures') ?>"
- title="<?php p($l->t('Toggle grid view'))?>"></label>
+ title="<?php p($_['showgridview'] ? $l->t('Show list view') : $l->t('Show grid view'))?>"></label>
<?php foreach ($_['appContents'] as $content) { ?>
<div id="app-content-<?php p($content['id']) ?>" class="hidden viewcontainer">
diff --git a/apps/files_sharing/templates/public.php b/apps/files_sharing/templates/public.php
index 889242fded1..d49c7a01b63 100644
--- a/apps/files_sharing/templates/public.php
+++ b/apps/files_sharing/templates/public.php
@@ -52,7 +52,7 @@ $maxUploadFilesize = min($upload_max_filesize, $post_max_size);
<input type="checkbox" class="hidden-visually" id="showgridview"
<?php if ($_['showgridview']) { ?>checked="checked" <?php } ?>/>
<label id="view-toggle" for="showgridview" class="button <?php p($_['showgridview'] ? 'icon-toggle-filelist' : 'icon-toggle-pictures') ?>"
- title="<?php p($l->t('Toggle grid view'))?>"></label>
+ title="<?php p($_['showgridview'] ? $l->t('Show list view') : $l->t('Show grid view'))?>"></label>
<?php } ?>
<!-- files listing -->
@@ -83,8 +83,8 @@ $maxUploadFilesize = min($upload_max_filesize, $post_max_size);
<?php p($l->t('Download'))?>
</a>
<?php } ?>
- </div>
- <?php } ?>
+ </div>
+ <?php } ?>
<?php endif; ?>
<?php if ($_['previewURL'] === $_['downloadURL'] && !$_['hideDownload']): ?>
<div class="directDownload">