From b634f1e2c70809a4fde7f738cb7c252b6fc3f4dc Mon Sep 17 00:00:00 2001 From: Vincent Petry Date: Thu, 25 Feb 2016 17:23:32 +0100 Subject: [PATCH] Make more action icons themable + style fixes Action icons now appear properly in public link page. More actions are now CSS icons. --- apps/files/css/files.css | 6 ++++-- apps/files/js/tagsplugin.js | 16 ++++++++-------- apps/files/templates/list.php | 10 ++++------ apps/files_sharing/css/sharetabview.css | 4 ++++ apps/files_trashbin/templates/index.php | 10 ++++------ core/js/sharedialogshareelistview.js | 3 +-- 6 files changed, 25 insertions(+), 24 deletions(-) diff --git a/apps/files/css/files.css b/apps/files/css/files.css index 3b1bea3fd9..b65af1fa0f 100644 --- a/apps/files/css/files.css +++ b/apps/files/css/files.css @@ -785,10 +785,12 @@ html.ie8 #controls .button.new { padding: 0; } -.app-files .fileactions .action .icon, -.app-files .actions .button .icon { +#filestable .filename .action .icon, +#filestable .selectedActions a .icon, +#controls .actions .button .icon { display: inline-block; vertical-align: middle; + background-size: 16px 16px; } .app-files .actions .button.new .icon { diff --git a/apps/files/js/tagsplugin.js b/apps/files/js/tagsplugin.js index 81b22e34cc..3c0a231d00 100644 --- a/apps/files/js/tagsplugin.js +++ b/apps/files/js/tagsplugin.js @@ -15,17 +15,18 @@ var TEMPLATE_FAVORITE_ACTION = '' + - '{{altText}}' + + '' + + '{{altText}}' + ''; /** - * Returns the path to the star image + * Returns the icon class for the matching state * * @param {boolean} state true if starred, false otherwise - * @return {string} path to star image + * @return {string} icon class for star image */ - function getStarImage(state) { - return OC.imagePath('core', state ? 'actions/starred' : 'actions/star'); + function getStarIconClass(state) { + return state ? 'icon-starred' : 'icon-star'; } /** @@ -41,7 +42,7 @@ return this._template({ isFavorite: state, altText: state ? t('files', 'Favorited') : t('files', 'Favorite'), - imgFile: getStarImage(state) + iconClass: getStarIconClass(state) }); } @@ -52,8 +53,7 @@ * @param {boolean} state true if starred, false otherwise */ function toggleStar($actionEl, state) { - $actionEl.find('img').attr('src', getStarImage(state)); - $actionEl.hide().show(0); //force Safari to redraw element on src change + $actionEl.removeClass('icon-star icon-starred').addClass(getStarIconClass(state)); $actionEl.toggleClass('permanent', state); } diff --git a/apps/files/templates/list.php b/apps/files/templates/list.php index ea3e6c61d4..29769bcd82 100644 --- a/apps/files/templates/list.php +++ b/apps/files/templates/list.php @@ -52,9 +52,8 @@ t( 'Name' )); ?> - " /> - t('Download'))?> + + t('Download'))?> @@ -65,9 +64,8 @@ t( 'Modified' )); ?> - t('Delete'))?> - " /> + t('Delete'))?> + diff --git a/apps/files_sharing/css/sharetabview.css b/apps/files_sharing/css/sharetabview.css index 642c0909af..0433882088 100644 --- a/apps/files_sharing/css/sharetabview.css +++ b/apps/files_sharing/css/sharetabview.css @@ -87,3 +87,7 @@ margin-top: 9px; } +.shareTabView .icon { + display: inline-block; + background-size: 16px 16px; +} diff --git a/apps/files_trashbin/templates/index.php b/apps/files_trashbin/templates/index.php index a7c1df93af..9ea8a9d14c 100644 --- a/apps/files_trashbin/templates/index.php +++ b/apps/files_trashbin/templates/index.php @@ -30,9 +30,8 @@ t( 'Name' )); ?> - " /> - t('Restore'))?> + + t('Restore'))?> @@ -41,9 +40,8 @@ t( 'Deleted' )); ?> - t('Delete'))?> - " /> + t('Delete'))?> + diff --git a/core/js/sharedialogshareelistview.js b/core/js/sharedialogshareelistview.js index e8976bb26e..49580cc888 100644 --- a/core/js/sharedialogshareelistview.js +++ b/core/js/sharedialogshareelistview.js @@ -17,7 +17,7 @@ '