-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Related to [#1154][] First, document the existing Attachment previewing process, including _which_ content types are supported out of the box. Next, resolve some `ManagedAttachment` to `Attachment` proxying issues. The `ManagedAttachment` class is what gets dispatched as part of `trix-attachment-add` events. It does not inherit from `Attachment`, but instead proxies method calls and property access. Prior to this commit, there were some proxy definition gaps. For example, the `ManagedAttachment` [declares a proxy for the `setAttribute` method][setAttribute]. Unfortunately, an `Attachment.setAttribute` method did not exist prior to these changes. This commit remedies that. Next, this commit adds proxy definitions for `Attachment.setPreviewURL` and `Attachment.getPreviewURL` so that event handlers can customize the value from the event-level `ManagedAttachment` instance, without deeply reaching into the `Attachment` instance (via `event.attachment.attachment`). [#1154]: #1154 [setAttribute]: https://github.com/basecamp/trix/blob/5db0ea49180de97f27b0becf47440690a1eaa39c/src/trix/models/managed_attachment.js#L22
- Loading branch information
1 parent
5db0ea4
commit 30fe30d
Showing
4 changed files
with
50 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters