From c2e2b624500bc54e55e1ff9c649483981e19b946 Mon Sep 17 00:00:00 2001 From: rishu2482 Date: Thu, 22 Mar 2018 09:26:00 +0530 Subject: [PATCH] Fixed #233 Fixed #233 | Hiding and then showing the layout doesn't re-calculate offsets properly. --- src/ui-layout.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/ui-layout.js b/src/ui-layout.js index 41253c8..502195f 100644 --- a/src/ui-layout.js +++ b/src/ui-layout.js @@ -641,7 +641,7 @@ angular.module('ui.layout', []) return ctrl; }]) - .directive('uiLayout', ['$window', function($window) { + .directive('uiLayout', ['$window', '$timeout', function($window, $timeout) { return { restrict: 'AE', controller: 'uiLayoutCtrl', @@ -649,7 +649,9 @@ angular.module('ui.layout', []) scope.$watch(function () { return element[0][ctrl.sizeProperties.offsetSize]; }, function() { - ctrl.calculate(); + $timeout(function(){ + ctrl.calculate(); + }); }); function onResize() {