striven-editor

Maintained and contributed to an open source WYSIWYG editor as an internship project that made it to production and was adopted by the company I was working at.
git clone https://unitehenry.com/git/striven-editor.git
Log | Files | Refs | README | LICENSE

commit f121fbaf96d88665c4122c3fedfd0a039d8704b7
parent 86ee4ffe665737a0efc7f2a9035303e047a9db95
Author: Henry Unite <unitehenry@gmail.com>
Date:   Thu, 15 Oct 2020 22:34:12 -0400

fire font options

Diffstat:
Msrc/striveneditor.js | 14+++++++++++---
1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/src/striveneditor.js b/src/striveneditor.js @@ -611,7 +611,7 @@ export default class StrivenEditor { fontOption.textContent = f; fontOption.style.fontFamily = f; - fontOption.onmousedown = e => { + const trigger = e => { let fontselect = e.target.textContent; select.textContent = fontselect; menu.close(); @@ -656,10 +656,15 @@ export default class StrivenEditor { se.body.focus(); }; - + + fontOption.onmousedown = trigger; + fontOption.onclick = trigger; + menu.append(fontOption); }); + + return menu; } @@ -690,7 +695,7 @@ export default class StrivenEditor { } } - fontOption.onmousedown = e => { + const trigger = e => { const fontsize = e.target.textContent; select.textContent = fontsize; @@ -726,6 +731,9 @@ export default class StrivenEditor { se.body.focus(); }; + fontOption.onmousedown = trigger; + fontOption.onclick = trigger; + menu.append(fontOption); });