Trix: Is it possible to disable the file attachments?

Created on 6 Mar 2019  路  3Comments  路  Source: basecamp/trix

This is not a bug... I am trying to disable file attachments as I鈥檇 like to use the monitor only for text. Is this possible? Did not see such an option in the configuration.

Thank you.

Most helpful comment

For those wanting a quick cut and paste: here it is:

// prevents attachments:
document.addEventListener("trix-file-accept", function(event) {
  event.preventDefault();
});

All 3 comments

If you don鈥檛 want to accept dropped or pasted files, call preventDefault() on the trix-file-accept event, which Trix dispatches just before the trix-attachment-add event.

https://github.com/basecamp/trix#storing-attached-files

Thank you so much!

For those wanting a quick cut and paste: here it is:

// prevents attachments:
document.addEventListener("trix-file-accept", function(event) {
  event.preventDefault();
});
Was this page helpful?
0 / 5 - 0 ratings