Skip to content

Commit

Permalink
Add check for if column is being resized so we dont reconfigure colum…
Browse files Browse the repository at this point in the history
…n widths.
  • Loading branch information
jonricaurte committed Jun 28, 2013
1 parent a4c42b4 commit 0bcb4d1
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 13 deletions.
10 changes: 7 additions & 3 deletions build/ng-grid.debug.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* ng-grid JavaScript Library
* Authors: https://github.com/angular-ui/ng-grid/blob/master/README.md
* License: MIT (http://www.opensource.org/licenses/mit-license.php)
* Compiled At: 06/27/2013 22:45
* Compiled At: 06/28/2013 00:08
***********************************************/
(function(window, $) {
'use strict';
Expand Down Expand Up @@ -826,6 +826,7 @@ var ngColumn = function (config, $scope, grid, domUtilityService, $templateCache
}
};
self.gripOnMouseDown = function(event) {
domUtilityService.isColumnResizing = true;
if (event.ctrlKey && !self.pinned) {
self.toggleVisible();
domUtilityService.BuildStyles($scope, grid);
Expand All @@ -850,7 +851,8 @@ var ngColumn = function (config, $scope, grid, domUtilityService, $templateCache
$(document).off('mouseup', self.gripOnMouseUp);
event.target.parentElement.style.cursor = 'default';
$scope.adjustScrollLeft(0);
//domUtilityService.digest($scope);
domUtilityService.digest($scope);
domUtilityService.isColumnResizing = false;
return false;
};
self.copy = function() {
Expand Down Expand Up @@ -1764,7 +1766,9 @@ var ngGrid = function ($scope, options, sortService, domUtilityService, $filter,
$scope.$emit('ngGridEventGroups', a);
}, true);
$scope.$watch('columns', function (a) {
domUtilityService.RebuildGrid($scope, self);
if(!domUtilityService.isColumnResizing){
domUtilityService.RebuildGrid($scope, self);
}
$scope.$emit('ngGridEventColumns', a);
}, true);
$scope.$watch(function() {
Expand Down
9 changes: 7 additions & 2 deletions build/ng-grid.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* ng-grid JavaScript Library
* Authors: https://github.com/angular-ui/ng-grid/blob/master/README.md
* License: MIT (http://www.opensource.org/licenses/mit-license.php)
* Compiled At: 06/27/2013 22:45
* Compiled At: 06/28/2013 00:08
***********************************************/
(function(window, $) {
'use strict';
Expand Down Expand Up @@ -769,6 +769,7 @@ var ngColumn = function (config, $scope, grid, domUtilityService, $templateCache
}
};
self.gripOnMouseDown = function(event) {
domUtilityService.isColumnResizing = true;
if (event.ctrlKey && !self.pinned) {
self.toggleVisible();
domUtilityService.BuildStyles($scope, grid);
Expand All @@ -793,6 +794,8 @@ var ngColumn = function (config, $scope, grid, domUtilityService, $templateCache
$(document).off('mouseup', self.gripOnMouseUp);
event.target.parentElement.style.cursor = 'default';
$scope.adjustScrollLeft(0);
domUtilityService.digest($scope);
domUtilityService.isColumnResizing = false;
return false;
};
self.copy = function() {
Expand Down Expand Up @@ -1507,7 +1510,9 @@ var ngGrid = function ($scope, options, sortService, domUtilityService, $filter,
$scope.$emit('ngGridEventGroups', a);
}, true);
$scope.$watch('columns', function (a) {
domUtilityService.RebuildGrid($scope, self);
if(!domUtilityService.isColumnResizing){
domUtilityService.RebuildGrid($scope, self);
}
$scope.$emit('ngGridEventColumns', a);
}, true);
$scope.$watch(function() {
Expand Down
4 changes: 2 additions & 2 deletions build/ng-grid.min.js

Large diffs are not rendered by default.

10 changes: 7 additions & 3 deletions ng-grid-2.0.7.debug.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* ng-grid JavaScript Library
* Authors: https://github.com/angular-ui/ng-grid/blob/master/README.md
* License: MIT (http://www.opensource.org/licenses/mit-license.php)
* Compiled At: 06/27/2013 22:45
* Compiled At: 06/28/2013 00:08
***********************************************/
(function(window, $) {
'use strict';
Expand Down Expand Up @@ -826,6 +826,7 @@ var ngColumn = function (config, $scope, grid, domUtilityService, $templateCache
}
};
self.gripOnMouseDown = function(event) {
domUtilityService.isColumnResizing = true;
if (event.ctrlKey && !self.pinned) {
self.toggleVisible();
domUtilityService.BuildStyles($scope, grid);
Expand All @@ -850,7 +851,8 @@ var ngColumn = function (config, $scope, grid, domUtilityService, $templateCache
$(document).off('mouseup', self.gripOnMouseUp);
event.target.parentElement.style.cursor = 'default';
$scope.adjustScrollLeft(0);
//domUtilityService.digest($scope);
domUtilityService.digest($scope);
domUtilityService.isColumnResizing = false;
return false;
};
self.copy = function() {
Expand Down Expand Up @@ -1764,7 +1766,9 @@ var ngGrid = function ($scope, options, sortService, domUtilityService, $filter,
$scope.$emit('ngGridEventGroups', a);
}, true);
$scope.$watch('columns', function (a) {
domUtilityService.RebuildGrid($scope, self);
if(!domUtilityService.isColumnResizing){
domUtilityService.RebuildGrid($scope, self);
}
$scope.$emit('ngGridEventColumns', a);
}, true);
$scope.$watch(function() {
Expand Down
4 changes: 2 additions & 2 deletions ng-grid-2.0.7.min.js

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions src/classes/column.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@
}
};
self.gripOnMouseDown = function(event) {
domUtilityService.isColumnResizing = true;
if (event.ctrlKey && !self.pinned) {
self.toggleVisible();
domUtilityService.BuildStyles($scope, grid);
Expand All @@ -145,6 +146,7 @@
event.target.parentElement.style.cursor = 'default';
$scope.adjustScrollLeft(0);
domUtilityService.digest($scope);
domUtilityService.isColumnResizing = false;
return false;
};
self.copy = function() {
Expand Down
4 changes: 3 additions & 1 deletion src/classes/grid.js
Original file line number Diff line number Diff line change
Expand Up @@ -548,7 +548,9 @@ var ngGrid = function ($scope, options, sortService, domUtilityService, $filter,
$scope.$emit('ngGridEventGroups', a);
}, true);
$scope.$watch('columns', function (a) {
domUtilityService.RebuildGrid($scope, self);
if(!domUtilityService.isColumnResizing){
domUtilityService.RebuildGrid($scope, self);
}
$scope.$emit('ngGridEventColumns', a);
}, true);
$scope.$watch(function() {
Expand Down

0 comments on commit 0bcb4d1

Please sign in to comment.