Skip to content

Commit 9c1d437

Browse files
Portugal, MarceloPortugal, Marcelo
authored andcommitted
gh-pages v4.0.1-138d149
1 parent b5bf97e commit 9c1d437

File tree

5 files changed

+67
-31
lines changed

5 files changed

+67
-31
lines changed

index.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,11 +76,11 @@ <h1 class="text-center">Angular UI Grid</h1>
7676
Code on Github
7777
</a>
7878

79-
<a class="btn btn-danger btn-large" href="https://github.com/angular-ui/ui-grid.info/tree/gh-pages/release" title="Download 3.0.7-305-g527f802-138d149">
79+
<a class="btn btn-danger btn-large" href="https://github.com/angular-ui/ui-grid.info/tree/gh-pages/release" title="Download 4.0.1-138d149">
8080
<i class="fa fa-download fa-fw"></i>
81-
<!-- Download <small>( 4.0.1 / 3.0.7-305-g527f802-138d149 )</small> --> <!-- TODO(c0bra): note: not showing stable version till 3.0.0 is released -->
81+
<!-- Download <small>( 4.0.1 / 4.0.1-138d149 )</small> --> <!-- TODO(c0bra): note: not showing stable version till 3.0.0 is released -->
8282

83-
Download <small>( 3.0.7-305-g527f802-138d149 )</small>
83+
Download <small>( 4.0.1-138d149 )</small>
8484
</a>
8585

8686
<a class="btn btn-success btn-large" href="/docs/#/tutorial" title="Tutorial">

release/ui-grid.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* ui-grid - v4.0.1 - 2016-12-15
2+
* ui-grid - v4.0.1-138d149 - 2016-12-29
33
* Copyright (c) 2016 ; License: MIT
44
*/
55
#ui-grid-twbs #ui-grid-twbs .form-horizontal .form-group:before,

release/ui-grid.js

Lines changed: 52 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* ui-grid - v4.0.1 - 2016-12-15
2+
* ui-grid - v4.0.1-138d149 - 2016-12-29
33
* Copyright (c) 2016 ; License: MIT
44
*/
55

@@ -2273,13 +2273,11 @@ function ($compile, $timeout, $window, $document, gridUtil, uiGridConstants, i18
22732273
angular.element($window).on('resize', applyHideMenu);
22742274
}
22752275

2276-
$scope.$on('$destroy', function () {
2277-
angular.element(document).off('click touchstart', applyHideMenu);
2278-
});
2279-
2280-
2281-
$scope.$on('$destroy', function() {
2276+
$scope.$on('$destroy', function unbindEvents() {
22822277
angular.element($window).off('resize', applyHideMenu);
2278+
angular.element(document).off('click touchstart', applyHideMenu);
2279+
$elm.off('keyup', checkKeyUp);
2280+
$elm.off('keydown', checkKeyDown);
22832281
});
22842282

22852283
if (uiGridCtrl) {
@@ -3214,7 +3212,9 @@ function ($compile, $timeout, $window, $document, gridUtil, uiGridConstants, i18
32143212
}
32153213
}
32163214

3217-
3215+
$scope.$on('$destroy', function unbindEvents() {
3216+
$elm.off();
3217+
});
32183218
},
32193219
controller: ['$scope', function ($scope) {
32203220
this.rowStyle = function (index) {
@@ -4784,7 +4784,7 @@ angular.module('ui.grid')
47844784
* @methodOf ui.grid.class:Grid
47854785
* @description returns the GridRow that contains the rowEntity
47864786
* @param {object} rowEntity the gridOptions.data array element instance
4787-
* @param {array} rows [optional] the rows to look in - if not provided then
4787+
* @param {array} lookInRows [optional] the rows to look in - if not provided then
47884788
* looks in grid.rows
47894789
*/
47904790
Grid.prototype.getRow = function getRow(rowEntity, lookInRows) {
@@ -4849,13 +4849,20 @@ angular.module('ui.grid')
48494849
self.rows.length = 0;
48504850

48514851
newRawData.forEach( function( newEntity, i ) {
4852-
var newRow;
4852+
var newRow, oldRow;
4853+
48534854
if ( self.options.enableRowHashing ){
48544855
// if hashing is enabled, then this row will be in the hash if we already know about it
4855-
newRow = oldRowHash.get( newEntity );
4856+
oldRow = oldRowHash.get( newEntity );
48564857
} else {
48574858
// otherwise, manually search the oldRows to see if we can find this row
4858-
newRow = self.getRow(newEntity, oldRows);
4859+
oldRow = self.getRow(newEntity, oldRows);
4860+
}
4861+
4862+
// update newRow to have an entity
4863+
if ( oldRow ) {
4864+
newRow = oldRow;
4865+
newRow.entity = newEntity;
48594866
}
48604867

48614868
// if we didn't find the row, it must be new, so create it
@@ -11786,6 +11793,11 @@ module.service('gridUtil', ['$log', '$window', '$document', '$http', '$templateC
1178611793
for ( var i = mouseWheeltoBind.length; i; ) {
1178711794
$elm.on(mouseWheeltoBind[--i], cbs[fn]);
1178811795
}
11796+
$elm.on('$destroy', function unbindEvents() {
11797+
for ( var i = mouseWheeltoBind.length; i; ) {
11798+
$elm.off(mouseWheeltoBind[--i], cbs[fn]);
11799+
}
11800+
});
1178911801
};
1179011802
s.off.mousewheel = function (elm, fn) {
1179111803
var $elm = angular.element(elm);
@@ -16436,7 +16448,11 @@ module.filter('px', function() {
1643616448
});
1643716449

1643816450

16439-
$scope.$on( '$destroy', rowWatchDereg );
16451+
$scope.$on('$destroy', function destroyEvents() {
16452+
rowWatchDereg();
16453+
// unbind all jquery events in order to avoid memory leaks
16454+
$elm.off();
16455+
});
1644016456

1644116457
function registerBeginEditEvents() {
1644216458
$elm.on('dblclick', beginEdit);
@@ -16971,6 +16987,11 @@ module.filter('px', function() {
1697116987

1697216988
return true;
1697316989
});
16990+
16991+
$scope.$on('$destroy', function unbindEvents() {
16992+
// unbind all jquery events in order to avoid memory leaks
16993+
$elm.off();
16994+
});
1697416995
}
1697516996
};
1697616997
}
@@ -17114,6 +17135,11 @@ module.filter('px', function() {
1711417135
}
1711517136
return true;
1711617137
});
17138+
17139+
$scope.$on('$destroy', function unbindEvents() {
17140+
// unbind jquery events to prevent memory leaks
17141+
$elm.off();
17142+
});
1711717143
}
1711817144
};
1711917145
}
@@ -17206,7 +17232,7 @@ module.filter('px', function() {
1720617232
}
1720717233
};
1720817234

17209-
$elm[0].addEventListener('change', handleFileSelect, false); // TODO: why the false on the end? Google
17235+
$elm[0].addEventListener('change', handleFileSelect, false);
1721017236

1721117237
$scope.$on(uiGridEditConstants.events.BEGIN_CELL_EDIT, function () {
1721217238
$elm[0].focus();
@@ -17216,13 +17242,17 @@ module.filter('px', function() {
1721617242
$scope.$emit(uiGridEditConstants.events.END_CELL_EDIT);
1721717243
});
1721817244
});
17245+
17246+
$scope.$on('$destroy', function unbindEvents() {
17247+
// unbind jquery events to prevent memory leaks
17248+
$elm.off();
17249+
$elm[0].removeEventListener('change', handleFileSelect, false);
17250+
});
1721917251
}
1722017252
};
1722117253
}
1722217254
};
1722317255
}]);
17224-
17225-
1722617256
})();
1722717257

1722817258
(function () {
@@ -22385,6 +22415,8 @@ module.filter('px', function() {
2238522415
movingElm.css({'width': reducedWidth + 'px'});
2238622416
}
2238722417
};
22418+
22419+
$scope.$on('$destroy', offAllEvents);
2238822420
}
2238922421
}
2239022422
};
@@ -25966,6 +25998,10 @@ module.filter('px', function() {
2596625998
window.setTimeout(function () { evt.target.onselectstart = null; }, 0);
2596725999
}
2596826000
}
26001+
26002+
$scope.$on('$destroy', function unbindEvents() {
26003+
$elm.off();
26004+
});
2596926005
}
2597026006
};
2597126007
}]);

release/ui-grid.min.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

release/ui-grid.min.js

Lines changed: 10 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)