feat(messages): add max file size for attachments
This commit is contained in:
parent
ef6d6aa368
commit
bcf47ec92b
7 changed files with 24 additions and 0 deletions
7
app/javascript/trix-editor-overrides.js
Normal file
7
app/javascript/trix-editor-overrides.js
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
// app/javascript/trix-editor-overrides.js
|
||||
window.addEventListener("trix-file-accept", function(event) {
|
||||
if (event.file.size > 1024 * 1024 * 512) {
|
||||
event.preventDefault()
|
||||
alert(I18n.t('js.trix_editor.file_size_alert'))
|
||||
}
|
||||
})
|
||||
Loading…
Add table
Add a link
Reference in a new issue