|
@@ -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>
|
|
@@ -57,6 +57,8 @@
|
|
|
|
|
|
const useViewer = useViewerStore()
|
|
const useViewer = useViewerStore()
|
|
const useDocument = useDocumentStore()
|
|
const useDocument = useDocumentStore()
|
|
|
|
+ const authorInput = ref(useDocument.getAuthor)
|
|
|
|
+ const annotatorInput = ref(useDocument.getAnnotator)
|
|
|
|
|
|
const show = computed(() => useViewer.isElementOpen('settingsDialog'))
|
|
const show = computed(() => useViewer.isElementOpen('settingsDialog'))
|
|
const author = computed(() => useDocument.getAuthor)
|
|
const author = computed(() => useDocument.getAuthor)
|
|
@@ -74,7 +76,15 @@
|
|
}
|
|
}
|
|
})
|
|
})
|
|
|
|
|
|
- watch([author, annotator, selectedLanguage, highlightLink, highlightForm], (newValues, oldValues) => {
|
|
|
|
|
|
+ watch(author, (newVal, oldVal) => {
|
|
|
|
+ authorInput.value = newVal
|
|
|
|
+ })
|
|
|
|
+
|
|
|
|
+ watch(annotator, (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 +105,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(authorInput.value ? authorInput.value : 'ComPDFKit')
|
|
|
|
+ useDocument.setAnnotator(annotatorInput.value ? annotatorInput.value : 'Guest')
|
|
useDocument.setHighlightLink(highlightLink.value)
|
|
useDocument.setHighlightLink(highlightLink.value)
|
|
useDocument.setHighlightForm(highlightForm.value)
|
|
useDocument.setHighlightForm(highlightForm.value)
|
|
}
|
|
}
|