-
-
Notifications
You must be signed in to change notification settings - Fork 842
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
Extract modal state #2162
Extract modal state #2162
Conversation
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.
A few observations from a quick reading.
Something additional: I would suggest already renaming every "prop" to "attrs" in the new and renamed classes to prepare for Mithril new naming. (like modalProps
, directly name it modalAttrs
). Not sure what @datitisev things about this. This would also apply to the other PRs
2952c26
to
96258f2
Compare
Should app.modal.show require a ModalState object? It would be more in line with what we're doing for Alerts, but would also require a bunch more imports... |
Not sure if I like having |
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'm ok for going ahead with this version of the PR.
I think we should regard ModalState
as internal/private API for now. We can still rework the internal later if necessary.
In later versions, I anticipate "ModalState" staying relatively constant, just that it wouldn't be stored in "ModalManagerState". That being said, the only change I'd make at this point is rename it to just "Modal" and put it in an |
96b3730
to
cc5c4ce
Compare
This is a bit more obvious, and more consistent with what we've done for alerts.
cc5c4ce
to
75728f5
Compare
- No more weird events - State only has show() and close() - The ModalManager handles Bootstrap's DOM events and signals corresponding state changes to the Modal component and the state. - The Modal component triggers the animations at the right time using Mithril's lifecycle hooks. TODO: - Remove debug output - Ensure that calling close() followed by show() works correctly - Document props
e515714
to
1cc02e9
Compare
* Fix closing the composer with ESC key Regression from #2161. * Remove obsolete method Regression from #2162. * Mark method as protected * Fade in posts in post stream using CSS This also avoids a double-fade from the JavaScript code, which was probably introduced in #2160. * Fix fadeIn for post stream items Co-authored-by: Alexander Skvortsov <sasha.skvortsov109@gmail.com>
* Fix closing the composer with ESC key Regression from #2161. * Remove obsolete method Regression from #2162. * Mark method as protected * Fade in posts in post stream using CSS This also avoids a double-fade from the JavaScript code, which was probably introduced in #2160. * Fix fadeIn for post stream items Co-authored-by: Alexander Skvortsov <sasha.skvortsov109@gmail.com>
Fixes Part of #1821, #2144
Changes proposed in this pull request:
Reviewers should focus on:
Confirmed
composer test
).