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æ <skjnldsv@protonmail.com>
  • Loading branch information
skjnldsv committed Aug 17, 2022
1 parent e4bce96 commit 9a2a7f6
Showing 1 changed file with 18 additions and 1 deletion.
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 9a2a7f6

Please sign in to comment.