-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
fixed cellHeight() check for no-op return #786
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
Conversation
the code that checked for cell height and unit being the same was incorrect. Testing Done: calling this should be no-op, but wasn't this.grid.cellHeight( this.grid.cellHeight() );
the code that checked for cell height and unit being the same was incorrect. Testing Done: calling this should be no-op, but wasn't this.grid.cellHeight( this.grid.cellHeight() );
| var e; | ||
| var w; | ||
| var gridstackHTML = | ||
| '<div class="grid-stack">' + |
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.
those are just formatting 2 spaces change. ignore.
| expect(grid.cellHeight()).toBe(120); | ||
| }); | ||
| }); | ||
|
|
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.
added simple test above to call cellHeight() after the fact to get more coverage. I don't know how to test to make sure grid changes height when increasing row height (80->120) which would fail to work correctly in the nested case (but might be ok otherwise).
| $('.grid-stack').gridstack(options); | ||
| var grid = $('.grid-stack').data('gridstack'); | ||
| var widgetHTML = | ||
| ' <div class="grid-stack-item">' + |
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.
again indentation fixes. ignore
| var heightData = Utils.parseHeight(val); | ||
|
|
||
| if (this.opts.cellHeightUnit === heightData.heightUnit && this.opts.height === heightData.height) { | ||
| if (this.opts.cellHeightUnit === heightData.unit && this.opts.cellHeight === heightData.height) { |
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.
code fix to use actual vars
the code that checked for cell height and unit being the same was incorrect.
Testing Done: calling this should be no-op, but wasn't
this.grid.cellHeight( this.grid.cellHeight() );
code right below uses correct names
this.opts.cellHeightUnit = heightData.unit;
this.opts.cellHeight = heightData.height;
P.S. this is why Typescript is good - you don't do those stupid JS typos....