Skip to content

Commit d74dd46

Browse files
committed
Merge pull request #5160 from trueblue2704/master
Fix for resizeHandler() being called 500 times
2 parents 41d3f0d + 08e9a10 commit d74dd46

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

misc/tutorial/110_grid_in_modal.ngdoc

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
Using a grid in a modal popup.
66

77
In some cases, and in particular with the bootstrap modal, you may find that your grid renders smaller than the
8-
available width (or sometimes appears to render not at all. This is believed to be because the bootstrap modal
9-
animates the initial render and the grid renders whilst the modal is still animating - the available space isn't
8+
available width (or sometimes appears to render not at all. This is believed to be because the bootstrap modal
9+
animates the initial render and the grid renders whilst the modal is still animating - the available space isn't
1010
as expected. You can correct this by calling `handleWindowResize`. The animation time seems to be somewhat variable,
1111
so the currently recommended approach is to use $interval, and to call every 500ms for the first 5s after modal opening.
1212

@@ -25,11 +25,11 @@ In a sense this is similar to what the auto-resize feature does, but it only doe
2525
$rootScope.gridOptions = {
2626
onRegisterApi: function (gridApi) {
2727
$scope.gridApi = gridApi;
28-
29-
// call resize every 200 ms for 2 s after modal finishes opening - usually only necessary on a bootstrap modal
28+
29+
// call resize every 500 ms for 5 s after modal finishes opening - usually only necessary on a bootstrap modal
3030
$interval( function() {
3131
$scope.gridApi.core.handleWindowResize();
32-
}, 10, 500);
32+
}, 500, 10);
3333
}
3434
};
3535

@@ -56,7 +56,7 @@ In a sense this is similar to what the auto-resize feature does, but it only doe
5656
$rootScope.close = function() {
5757
modal.close();
5858
};
59-
59+
6060
$rootScope.modalStyle = {"display": "block"};
6161

6262
$compile(elm)($rootScope);
@@ -92,4 +92,4 @@ In a sense this is similar to what the auto-resize feature does, but it only doe
9292
element( by.id ( 'buttonClose' ) ).click();
9393
});
9494
</file>
95-
</example>
95+
</example>

0 commit comments

Comments
 (0)