Skip to content

Commit 724883f

Browse files
author
Alex
committed
GridRenderContainer.js registerViewportAdjuster patch
- renamed wrongly named 'registerViewportAdjuster' fn to 'removeViewportAdjuster' - when checking if a function is in the viewportAdjusters array need to check that its index is > -1
1 parent 8f1dc7e commit 724883f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/js/core/factories/GridRenderContainer.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,10 +174,10 @@ angular.module('ui.grid')
174174
* @description Removes an adjuster, should be used when your element is destroyed
175175
* @param {function} func the adjuster function we want to remove
176176
*/
177-
GridRenderContainer.prototype.removeViewportAdjuster = function registerViewportAdjuster(func) {
177+
GridRenderContainer.prototype.removeViewportAdjuster = function removeViewportAdjuster(func) {
178178
var idx = this.viewportAdjusters.indexOf(func);
179179

180-
if (typeof(idx) !== 'undefined' && idx !== undefined) {
180+
if (idx > -1) {
181181
this.viewportAdjusters.splice(idx, 1);
182182
}
183183
};

0 commit comments

Comments
 (0)