Fix the image button in the formatting toolbar.
Review Request #13211 — Created Aug. 14, 2023 and submitted
Information | |
---|---|
maubin | |
Review Board | |
release-6.x | |
Reviewers | |
reviewboard | |
The image button in the formatting toolbar would prompt for a file, but never
actually inserted it into the editor. This change fixes that.
- Tested uploading images through the image button in empty and non-empty
editors, and at various positions in the editor. Saw that this behaved in
the same way as dragging and dropping images. - Tested using the other buttons in the editor.

Commits: |
|
||||||
---|---|---|---|---|---|---|---|
Diff: |
Revision 2 (+64 -2) |
Checks run (2 succeeded)
flake8
passed.
JSHint
passed.
-
-
The custom
_uploadImage
callback on the interface is going to be too specific to this case, and it's not something that extensions could take advantage of.I think an approach worth exploring is just letting this button emit an event on the view, e.g.
uploadImage
.TextEditorView
could then listen to this event and do the right thing. If something else were to useFormattingToolbarView
(theoretically), it could implement its own logic there.

Commits: |
|
||||||
---|---|---|---|---|---|---|---|
Diff: |
Revision 3 (+56 -2) |
Checks run (2 succeeded)
flake8
passed.
JSHint
passed.