aboutsummaryrefslogblamecommitdiffstats
path: root/app/javascript/actiontext/index.js
blob: c149eda952b48981b38934b0fcf421f572d69c35 (plain) (tree)
1
2
3
4
5
6
7
8
9
                            
                                                      
 
                                                  
                                      
 


                                                           
   
  
import * as Trix from "trix"
import { AttachmentUpload } from "./attachment_upload"

addEventListener("trix-attachment-add", event => {
  const { attachment, target } = event

  if (attachment.file) {
    const upload = new AttachmentUpload(attachment, target)
    upload.start()
  }
})