Skip to content

Commit

Permalink
Force editor with dark theme
Browse files Browse the repository at this point in the history
Signed-off-by: John Molakvoæ <[email protected]>
Signed-off-by: nextcloud-command <[email protected]>
  • Loading branch information
skjnldsv authored and nextcloud-command committed Aug 17, 2022
1 parent e4bce96 commit b0ad7a4
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 4 deletions.
4 changes: 2 additions & 2 deletions js/viewer-main.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/viewer-main.js.map

Large diffs are not rendered by default.

19 changes: 18 additions & 1 deletion src/components/ImageEditor.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<div ref="editor" class="viewer__image-editor" />
<div ref="editor" class="viewer__image-editor" v-bind="themeDataAttr" />
</template>
<script>
import FilerobotImageEditor from 'filerobot-image-editor'
Expand Down Expand Up @@ -84,12 +84,29 @@ export default {
},
}
},
defaultSavedImageName() {
return basename(this.src, extname(this.src))
},
defaultSavedImageType() {
return extname(this.src).slice(1) || 'jpeg'
},
hasHighContrastEnabled() {
const themes = OCA?.Theming?.enabledThemes || []
return themes.find(theme => theme.indexOf('highcontrast') !== -1)
},
themeDataAttr() {
if (this.hasHighContrastEnabled) {
return {
'data-theme-dark-highcontrast': true,
}
}
return {
'data-theme-dark': true,
}
}
},
mounted() {
Expand Down

0 comments on commit b0ad7a4

Please sign in to comment.