Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
fix collabora icon color invertion issue in bright theme
Signed-off-by: Luka Trovic <[email protected]>
  • Loading branch information
luka-nextcloud committed Sep 28, 2021
commit 8929a8c7c4aad7a3af1b99de1f256c731abf8695
8 changes: 8 additions & 0 deletions css/viewer.scss
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,14 @@
background-image: url('../img/x-office-presentation.svg');
}

.icon-collabora {
cursor: pointer;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

opacity: 0.6;
&:hover {
opacity: 1;
}
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should use tabs instead of spaces 😉


.richdocuments-sharing .icon-shared {
display: block;
width: 16px;
Expand Down
6 changes: 4 additions & 2 deletions src/view/FilesAppIntegration.js
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,8 @@ export default {

_addHeaderShareButton() {
if ($('header').length) {
const $button = $('<div id="richdocuments-sharing"><a class="icon-shared icon-white"></a></div>')
const isInverted = window.OCA.Theming.inverted
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be on the safe side if the theming app is disabled:

Suggested change
const isInverted = window.OCA.Theming.inverted
const isInverted = Boolean(window?.OCA?.Theming?.inverted)

const $button = $('<div id="richdocuments-sharing"><a class="icon-collabora icon-shared ' + (isInverted ? 'icon-black' : 'icon-white') + '"></a></div>')
$('#richdocuments-header').append($button)
$button.on('click', () => {
if (!$('#app-sidebar').is(':visible')) {
Expand All @@ -277,7 +278,8 @@ export default {
console.debug('[FilesAppIntegration] Adding header file actions')
OC.unregisterMenu($('#richdocuments-actions .icon-more'), $('#richdocuments-actions-menu'))
$('#richdocuments-actions').remove()
const actionsContainer = $('<div id="richdocuments-actions"><div class="icon-more icon-white"></div><ul id="richdocuments-actions-menu" class="popovermenu"></ul></div>')
const isInverted = window.OCA.Theming.inverted
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

const actionsContainer = $('<div id="richdocuments-actions"><div class="icon-collabora icon-more ' + (isInverted ? 'icon-black' : 'icon-white') + '"></div><ul id="richdocuments-actions-menu" class="popovermenu"></ul></div>')
const actions = actionsContainer.find('#richdocuments-actions-menu').empty()

const getContext = () => ({
Expand Down