-
Notifications
You must be signed in to change notification settings - Fork 27
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
Removed render modifiers from Daily/Weekly calendar #8326
Removed render modifiers from Daily/Weekly calendar #8326
Conversation
NTS: Try to use the existing |
…-component modifier instead
OK, simplified the whole thing and changed to an in-component |
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.
LGTM, overall just a few minor changes and this should be good to go.
|
||
if (earliestHour < 24 && earliestHour > 2) { | ||
hourElement = this[`hour${earliestHour}`]; | ||
hourElement = document.getElementsByClassName(`hour-${earliestHour}`)[0]; |
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.
hourElement = document.getElementsByClassName(`hour-${earliestHour}`)[0]; | |
hourElement = element.getElementsByClassName(`hour-${earliestHour}`)[0]; |
let hourElement = this.hour6; | ||
scrollView = modifier((element, [earliestHour]) => { | ||
// all of the hour elements are registered in the template as hour-0, hour-1, etc | ||
let hourElement = document.getElementsByClassName(`hour-6`)[0]; |
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.
let hourElement = document.getElementsByClassName(`hour-6`)[0]; | |
let hourElement = element.getElementsByClassName(`hour-6`)[0]; |
|
||
if (earliestHour < 24 && earliestHour > 2) { | ||
hourElement = this[`hour${earliestHour}`]; | ||
hourElement = document.getElementsByClassName(`hour-${earliestHour}`)[0]; |
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.
hourElement = document.getElementsByClassName(`hour-${earliestHour}`)[0]; | |
hourElement = element.getElementsByClassName(`hour-${earliestHour}`)[0]; |
let hourElement = this.hour6; | ||
scrollView = modifier((element, [earliestHour]) => { | ||
// all of the hour elements are registered in the template as hour-0, hour-1, etc | ||
let hourElement = document.getElementsByClassName(`hour-6`)[0]; |
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.
suggesting to anchor this query to the passed-in container element instead of the document root note.
scoping this down reduces churn and prevents potential class-name collisions.
let hourElement = document.getElementsByClassName(`hour-6`)[0]; | |
let hourElement = element.getElementsByClassName(`hour-6`)[0]; |
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.
LGTM
Refs ilios/ilios#5374
Couldn't figure any other way out, so I basically re-created
{{did-update}}
as a custom modifier calledon-update
. All it does it take in an event to listen for, and run a callback with an argument. This meant changing the scroll mechanism from atask
-like call to a simple@action
.No idea if this is the way we want to approach stuff like this, but it's a start!