Fix the image button in the formatting toolbar.
Review Request #13211 — Created Aug. 14, 2023 and submitted
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:
-
Summary ID 4902757d9e5dedefcf14f85ebdffa562cf6b585f 4d110f846f79cc584b710bbd36f2e742917a8be9
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.