mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-12-10 22:09:38 +00:00
Merge pull request #4349 from advplyr/trix_prevent_attachments
Some checks are pending
CodeQL / Analyze (push) Waiting to run
Run Component Tests / Run Component Tests (push) Waiting to run
Build and Push Docker Image / build (push) Waiting to run
Integration Test / build and test (push) Waiting to run
Run Unit Tests / Run Unit Tests (push) Waiting to run
Some checks are pending
CodeQL / Analyze (push) Waiting to run
Run Component Tests / Run Component Tests (push) Waiting to run
Build and Push Docker Image / build (push) Waiting to run
Integration Test / build and test (push) Waiting to run
Run Unit Tests / Run Unit Tests (push) Waiting to run
Update rich text editor to prevent pasting in images from the browser
This commit is contained in:
commit
f44c2d9e11
1 changed files with 7 additions and 1 deletions
|
|
@ -31,7 +31,7 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</trix-toolbar>
|
</trix-toolbar>
|
||||||
<trix-editor :toolbar="toolbarId" :contenteditable="!disabledEditor" :class="['trix-content']" ref="trix" :input="computedId" :placeholder="placeholder" @trix-change="handleContentChange" @trix-initialize="handleInitialize" @trix-focus="processTrixFocus" @trix-blur="processTrixBlur" />
|
<trix-editor :toolbar="toolbarId" :contenteditable="!disabledEditor" :class="['trix-content']" ref="trix" :input="computedId" :placeholder="placeholder" @trix-change="handleContentChange" @trix-initialize="handleInitialize" @trix-focus="processTrixFocus" @trix-blur="processTrixBlur" @trix-attachment-add="handleAttachmentAdd" />
|
||||||
<input type="hidden" :name="inputName" :id="computedId" :value="editorContent" />
|
<input type="hidden" :name="inputName" :id="computedId" :value="editorContent" />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
@ -316,6 +316,12 @@ export default {
|
||||||
if (this.$refs.trix && this.$refs.trix.blur) {
|
if (this.$refs.trix && this.$refs.trix.blur) {
|
||||||
this.$refs.trix.blur()
|
this.$refs.trix.blur()
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
handleAttachmentAdd(event) {
|
||||||
|
// Prevent pasting in images from the browser
|
||||||
|
if (!event.attachment.file) {
|
||||||
|
event.attachment.remove()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue