diff --git a/doc/CHANGES.md b/doc/CHANGES.md index 5bf1d19bc..e69f97196 100644 --- a/doc/CHANGES.md +++ b/doc/CHANGES.md @@ -24,6 +24,7 @@ Change log ## v0.5.2-dev (upcoming changes) +- fix widgets not animating when animate: true is used. on every move, styles were recreated-fix should slightly improve gridstack.js speed ([#937](https://github.com/gridstack/gridstack.js/issues/937)). - fix moving widgets when having multiple grids. jquery-ui workaround ([#1043](https://github.com/gridstack/gridstack.js/issues/1043)). - switch to eslint ([#763](https://github.com/gridstack/gridstack.js/issues/763)). - null values to addWidget() exception fix ([#1042](https://github.com/gridstack/gridstack.js/issues/1042)). diff --git a/src/gridstack.js b/src/gridstack.js index ac1e06074..10b09adc1 100644 --- a/src/gridstack.js +++ b/src/gridstack.js @@ -1094,14 +1094,15 @@ if (typeof maxHeight == 'undefined') { maxHeight = this._styles._max; } + + if (this._styles._max !== 0 && maxHeight <= this._styles._max) { // Keep this._styles._max increasing + return ; + } this._initStyles(); this._updateContainerHeight(); if (!this.opts.cellHeight) { // The rest will be handled by CSS return ; } - if (this._styles._max !== 0 && maxHeight <= this._styles._max) { // Keep this._styles._max increasing - return ; - } if (!this.opts.verticalMargin || this.opts.cellHeightUnit === this.opts.verticalMarginUnit) { getHeight = function(nbRows, nbMargins) {