-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
allow height/contentHeight to accept a function for dynamic value #3271
allow height/contentHeight to accept a function for dynamic value #3271
Conversation
this makes it a lot easier to size the control to its container. for example, implementations could do `return container_el.clientHeight`
@@ -108,6 +114,61 @@ | |||
}); | |||
}); | |||
|
|||
describe('as a function, when there are no events', function() { |
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.
not a big deal, but this is a lot of copypasta from the other tests. would you be able to DRY it up? recommended format to do so:
[
{ description: 'as a number', height: 600 },
{ description: 'as a function', height: getParentHeight, heightWrapper: true }
].forEach(function(testInfo) {
describe(testInfo.description, function() {
if (testInfo.heightWrapper) {
beforeEach(function() {
calendarEl.wrap('<div class="calendar-container" style="height: 600px;" />');
});
}
describe('when there are no events', function() {
// ...
});
// ...
});
});
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.
also, this will make a "parent"
setting much easier to write tests for (pretty much the same tests as getParentHeight
)
awesome! thanks for carrying this through to the finish line. would you be able to add another setting as a shortcut to setting a 100% to the parent? the value would just be One thing we might want to test for is that the function and Could you just modify this existing manual test? |
looks great! thanks for the hard work on this one. i'll merge it into the upcoming release. |
In my testing, the height does get auto-updated when the window is resized, but not as smoothly as when doing |
I'll document |
this is released in v2.9.1 docs i've updated: windowResizeDelay: thank you @caseyjhol ! |
cool 👍 |
This is a fork of #3040. Instead of adding a new
getContainerHeight
option, this simply allows height and contentHeight to accept a function.See a preview here: http://plnkr.co/edit/O0iBHMcFa0faPE8XyPb3?p=preview where
height
is a function that returns the height of the calendar's parent (which is an absolutely positioned DIV with{top: 200px, right: 0, bottom: 0, left: 0;}
).