Skip to content

Commit 7fc55b5

Browse files
committed
fix(uiGrid): introduced a bug that added columns over and over when data was swapped
1 parent c97db35 commit 7fc55b5

File tree

1 file changed

+9
-11
lines changed

1 file changed

+9
-11
lines changed

src/js/core/directives/ui-grid.js

+9-11
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@
5656
* @description factory to return dom specific instances of a grid
5757
*
5858
*/
59-
module.service('gridClassFactory', ['gridUtil','$q','$templateCache','uiGridConstants','$log',
60-
function (gridUtil,$q,$templateCache,uiGridConstants,$log) {
59+
module.service('gridClassFactory', ['gridUtil', '$q', '$templateCache', 'uiGridConstants', '$log',
60+
function (gridUtil, $q, $templateCache, uiGridConstants, $log) {
6161

6262
var service = {
6363
/**
@@ -193,10 +193,10 @@
193193
}
194194
var col = self.getColumn(colDef.field);
195195

196-
//if (!col) {
196+
if (!col) {
197197
col = new GridColumn(colDef, index);
198198
self.columns.push(col);
199-
//}
199+
}
200200

201201
self.columnBuilders.forEach(function (builder) {
202202
builderPromises.push(builder.call(self, colDef, col, self.options));
@@ -412,7 +412,7 @@
412412
* @param {ColDef} colDef column definition
413413
* @returns {string} resulting name that can be evaluated on scope
414414
*/
415-
GridRow.prototype.getQualifiedColField = function(colDef){
415+
GridRow.prototype.getQualifiedColField = function(colDef) {
416416
return 'row.entity.' + colDef.field;
417417
};
418418

@@ -452,8 +452,7 @@
452452
return service;
453453
}]);
454454

455-
module.controller('uiGridController',['$scope', '$element', '$attrs','$log','gridUtil','$q','uiGridConstants',
456-
'$templateCache','gridClassFactory',
455+
module.controller('uiGridController', ['$scope', '$element', '$attrs', '$log', 'gridUtil', '$q', 'uiGridConstants', '$templateCache', 'gridClassFactory',
457456
function ($scope, $elm, $attrs, $log, gridUtil, $q, uiGridConstants, $templateCache, gridClassFactory) {
458457
$log.debug('ui-grid controller');
459458

@@ -538,8 +537,8 @@
538537
};
539538

540539
//todo: throttle this event?
541-
self.fireScrollEvent = function(){
542-
$scope.$broadcast(uiGridConstants.events.GRID_SCROLL,'vertical');
540+
self.fireScrollEvent = function() {
541+
$scope.$broadcast(uiGridConstants.events.GRID_SCROLL, 'vertical');
543542
};
544543

545544
}]);
@@ -610,12 +609,11 @@ module.directive('uiGrid',
610609
]);
611610

612611

613-
module.directive('uiGridCell', ['$compile','uiGridConstants','$log', function ($compile,uiGridConstants,$log) {
612+
module.directive('uiGridCell', ['$compile', 'uiGridConstants', '$log', function ($compile, uiGridConstants, $log) {
614613
var ngCell = {
615614
priority: 0,
616615
scope: false,
617616
compile: function() {
618-
619617
return {
620618
pre: function($scope, $elm) {
621619
// $log.debug('uiGridCell pre-link');

0 commit comments

Comments
 (0)