Skip to content

Commit

Permalink
fix(uiGrid): introduced a bug that added columns over and over when d…
Browse files Browse the repository at this point in the history
…ata was swapped
  • Loading branch information
c0bra committed Jan 15, 2014
1 parent c97db35 commit 7fc55b5
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions src/js/core/directives/ui-grid.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@
* @description factory to return dom specific instances of a grid
*
*/
module.service('gridClassFactory', ['gridUtil','$q','$templateCache','uiGridConstants','$log',
function (gridUtil,$q,$templateCache,uiGridConstants,$log) {
module.service('gridClassFactory', ['gridUtil', '$q', '$templateCache', 'uiGridConstants', '$log',
function (gridUtil, $q, $templateCache, uiGridConstants, $log) {

var service = {
/**
Expand Down Expand Up @@ -193,10 +193,10 @@
}
var col = self.getColumn(colDef.field);

//if (!col) {
if (!col) {
col = new GridColumn(colDef, index);
self.columns.push(col);
//}
}

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

Expand Down Expand Up @@ -452,8 +452,7 @@
return service;
}]);

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

Expand Down Expand Up @@ -538,8 +537,8 @@
};

//todo: throttle this event?
self.fireScrollEvent = function(){
$scope.$broadcast(uiGridConstants.events.GRID_SCROLL,'vertical');
self.fireScrollEvent = function() {
$scope.$broadcast(uiGridConstants.events.GRID_SCROLL, 'vertical');
};

}]);
Expand Down Expand Up @@ -610,12 +609,11 @@ module.directive('uiGrid',
]);


module.directive('uiGridCell', ['$compile','uiGridConstants','$log', function ($compile,uiGridConstants,$log) {
module.directive('uiGridCell', ['$compile', 'uiGridConstants', '$log', function ($compile, uiGridConstants, $log) {
var ngCell = {
priority: 0,
scope: false,
compile: function() {

return {
pre: function($scope, $elm) {
// $log.debug('uiGridCell pre-link');
Expand Down

0 comments on commit 7fc55b5

Please sign in to comment.