|
@@ -6,11 +6,11 @@
|
|
<div class="info">
|
|
<div class="info">
|
|
<div class="row">
|
|
<div class="row">
|
|
<span>{{ $t('header.settings.author') }}</span>
|
|
<span>{{ $t('header.settings.author') }}</span>
|
|
- <input type="text" placeholder="ComPDFKit" v-model="author" name="settings">
|
|
|
|
|
|
+ <input type="text" placeholder="ComPDFKit" v-model="authorInput" name="settings">
|
|
</div>
|
|
</div>
|
|
<div class="row">
|
|
<div class="row">
|
|
<span>{{ $t('header.settings.annotator') }}</span>
|
|
<span>{{ $t('header.settings.annotator') }}</span>
|
|
- <input type="text" placeholder="Guest" v-model="annotator" name="settings">
|
|
|
|
|
|
+ <input type="text" placeholder="Guest" v-model="annotatorInput" name="settings">
|
|
</div>
|
|
</div>
|
|
<div class="row">
|
|
<div class="row">
|
|
<span>{{ $t('header.settings.language') }}</span>
|
|
<span>{{ $t('header.settings.language') }}</span>
|
|
@@ -61,6 +61,8 @@
|
|
const show = computed(() => useViewer.isElementOpen('settingsDialog'))
|
|
const show = computed(() => useViewer.isElementOpen('settingsDialog'))
|
|
const author = computed(() => useDocument.getAuthor)
|
|
const author = computed(() => useDocument.getAuthor)
|
|
const annotator = computed(() => useDocument.getAnnotator)
|
|
const annotator = computed(() => useDocument.getAnnotator)
|
|
|
|
+ const authorInput = ref(useDocument.getAuthor)
|
|
|
|
+ const annotatorInput = ref(useDocument.getAnnotator)
|
|
const selectedLanguage = ref(locale.value)
|
|
const selectedLanguage = ref(locale.value)
|
|
const highlightLink = ref(true)
|
|
const highlightLink = ref(true)
|
|
const highlightForm = ref(true)
|
|
const highlightForm = ref(true)
|
|
@@ -74,7 +76,13 @@
|
|
}
|
|
}
|
|
})
|
|
})
|
|
|
|
|
|
- watch([author, annotator, selectedLanguage, highlightLink, highlightForm], (newValues, oldValues) => {
|
|
|
|
|
|
+ watch(annotator, (newVal, oldVal) => {
|
|
|
|
+ if (newVal !== oldVal) {
|
|
|
|
+ annotatorInput.value = newVal
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+
|
|
|
|
+ watch([authorInput, annotatorInput, selectedLanguage, highlightLink, highlightForm], (newValues, oldValues) => {
|
|
if (newValues[0] !== useDocument.getAuthor ||
|
|
if (newValues[0] !== useDocument.getAuthor ||
|
|
newValues[1] !== useDocument.getAnnotator ||
|
|
newValues[1] !== useDocument.getAnnotator ||
|
|
newValues[2] !== locale.value ||
|
|
newValues[2] !== locale.value ||
|
|
@@ -95,8 +103,8 @@
|
|
locale.value = selectedLanguage.value
|
|
locale.value = selectedLanguage.value
|
|
window.localStorage.setItem('language', selectedLanguage.value)
|
|
window.localStorage.setItem('language', selectedLanguage.value)
|
|
useViewer.closeElement('settingsDialog')
|
|
useViewer.closeElement('settingsDialog')
|
|
- useDocument.setAuthor(author.value ? author.value : 'ComPDFKit')
|
|
|
|
- useDocument.setAnnotator(annotator.value ? annotator.value : 'Guest')
|
|
|
|
|
|
+ useDocument.setAuthor(author.value ? authorInput.value : 'ComPDFKit')
|
|
|
|
+ useDocument.setAnnotator(annotator.value ? annotatorInput.value : 'Guest')
|
|
useDocument.setHighlightLink(highlightLink.value)
|
|
useDocument.setHighlightLink(highlightLink.value)
|
|
useDocument.setHighlightForm(highlightForm.value)
|
|
useDocument.setHighlightForm(highlightForm.value)
|
|
}
|
|
}
|