-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Port ui/editor to snabbdom and TypeScript #5655
Conversation
Awesome. Is that ready? |
@@ -21,7 +21,7 @@ object editor { | |||
moreJs = frag( | |||
jsAt(s"compiled/lichess.editor${isProd ?? (".min")}.js"), | |||
embedJsUnsafe(s"""var data=${safeJsonValue(bits.jsData(sit, fen, animationDuration))};data.positions=$positionsJson; | |||
LichessEditor(document.getElementById('board-editor'), data);""") | |||
LichessEditor.default(document.querySelector('#board-editor > .board-editor'), data);""") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like snabbdom replaces the element instead of replacing its content. I wonder if there is a more elegant way.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think in the other modules I just recreate the main#board-editor
root with snabbdom.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a bit awkward, because the editor can also be embedded in the study chapter dialog.
I think so, yes. Edit: In it's current form, requires full deploy, because of the issue above. |
No description provided.