Commit 57c65116 authored by radiolips's avatar radiolips Committed by GitHub
Browse files

Merge pull request #786 from adumesny/develop

fixed cellHeight() check for no-op return
parents 10e141ed b00f8160
......@@ -244,6 +244,38 @@ describe('gridstack', function() {
});
});
describe('grid.cellHeight', function() {
beforeEach(function() {
document.body.insertAdjacentHTML(
'afterbegin', gridstackHTML);
});
afterEach(function() {
document.body.removeChild(document.getElementsByClassName('grid-stack')[0]);
});
it('should have no changes', function() {
var options = {
cellHeight: 80,
verticalMargin: 10,
width: 12
};
$('.grid-stack').gridstack(options);
var grid = $('.grid-stack').data('gridstack');
grid.cellHeight( grid.cellHeight() );
expect(grid.cellHeight()).toBe(80);
});
it('should change cellHeight to 120', function() {
var options = {
cellHeight: 80,
verticalMargin: 10,
width: 10
};
$('.grid-stack').gridstack(options);
var grid = $('.grid-stack').data('gridstack');
grid.cellHeight( 120 );
expect(grid.cellHeight()).toBe(120);
});
});
describe('grid.minWidth', function() {
beforeEach(function() {
document.body.insertAdjacentHTML(
......
......@@ -1610,7 +1610,7 @@
}
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) {
return ;
}
this.opts.cellHeightUnit = heightData.unit;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment