In cases where the palette is rerendered - switching themes, toggling vertical color box mode, loading a palette, etc.,
a leaked event listener or other places could throw an error similar to:
Uncaught TypeError: $foreground_color.data(...) is not a function
- If you opened the Edit Colors dialog, but changed the UI theme before hitting OK, it would fail to update the color or close the dialog. This is fixed. It now uses an index into the palette so it even works if you change the palette completely while the dialog is open. Differently sized palettes are also handled.
- If you opened the Edit Colors dialog, but switched to monochrome mode in Image > Attributes before hitting OK, it would partially fail to update the color - it would visually change the color cell, but if you selected it, it would select the old pattern. This is fixed.
- If you toggled Vertical Color Box mode, the palette broke - you could no longer select colors. This is fixed.
- I haven't fixed the event listener leak itself.
Fixes https://github.com/1j01/jspaint/issues/114 and makes opening the color dialog work with Eye Gaze Mode dwell clicks and Speech Recognition as well (which can't trigger a "user gesture" as far as the browser's security model is concerned).
$ lebab --replace src/ --transform let
src/$Component.js:
59: warning Unable to transform var (let)
60: warning Unable to transform var (let)
97: warning Unable to transform var (let)
138: warning Unable to transform var (let)
src/$Window.js:
74: warning Unable to transform var (let)
src/app.js:
662: warning Unable to transform var (let)
460: warning Unable to transform var (let)
612: warning Unable to transform var (let)
613: warning Unable to transform var (let)
614: warning Unable to transform var (let)
src/functions.js:
756: warning Unable to transform var (let)
src/image-manipulation.js:
245: warning Unable to transform var (let)
826: warning Unable to transform var (let)
src/imgur.js:
48: warning Unable to transform var (let)
173: warning Unable to transform var (let)
Use URL.createObjectURL() instead of creating a FileReader and reading as a data URL
Add a bunch of error handling around opening files
Make GIF rendering errors use new show_error_message function
Remove some old bits from intending to use Web Intents