Skip to content

Commit

Permalink
check for null references on $destroy and updateGridLayout
Browse files Browse the repository at this point in the history
  • Loading branch information
mikeromano38 authored and c0bra committed Apr 25, 2014
1 parent 04c1848 commit 955c672
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/classes/eventProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@
grid.$topPanel.on('mousedown', '.ngHeaderScroller', self.onHeaderMouseDown).on('dragover', '.ngHeaderScroller', self.dragOver);

grid.$groupPanel.on('$destroy', function() {
grid.$groupPanel.off('mousedown');
if (grid.$groupPanel){
grid.$groupPanel.off('mousedown');
}

grid.$groupPanel = null;
});
Expand All @@ -31,9 +33,11 @@
}

grid.$topPanel.on('$destroy', function() {
grid.$topPanel.off('mousedown');
if (grid.$topPanel){
grid.$topPanel.off('mousedown');
}

if (grid.config.enableColumnReordering) {
if (grid.config.enableColumnReordering && grid.$topPanel) {
grid.$topPanel.off('drop');
}

Expand Down
3 changes: 3 additions & 0 deletions src/services/DomUtilityService.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@
return width;
};
domUtilityService.UpdateGridLayout = function($scope, grid) {
if (!grid.$root){
return;
}
//catch this so we can return the viewer to their original scroll after the resize!
var scrollTop = grid.$viewport.scrollTop();
grid.elementDims.rootMaxW = grid.$root.width();
Expand Down

0 comments on commit 955c672

Please sign in to comment.