Skip to content

Commit

Permalink
changes for column align feature
Browse files Browse the repository at this point in the history
  • Loading branch information
iamisti committed Jun 2, 2015
1 parent 2946195 commit 2d8c089
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 7 deletions.
32 changes: 32 additions & 0 deletions .jshintrc
@@ -0,0 +1,32 @@
{
"node": true,
"browser": true,
"esnext": true,
"bitwise": true,
"camelcase": true,
"curly": true,
"eqeqeq": true,
"immed": true,
"indent": 4,
"latedef": false,
"newcap": true,
"noarg": true,
"quotmark": "single",
"undef": true,
"unused": true,
"strict": true,
"trailing": true,
"smarttabs": true,
"multistr": true,
"validthis": true,
"globals":{
"angular" : false,
"_":false,
"$" : false,
"uuid" : false,
"Raphael" : false,
"$$UMFP" : false,
"loadJSON" : false,
"Detectizr" : false
}
}
6 changes: 3 additions & 3 deletions app/modules/main/directives/mdDataTableColumnDirective.js
@@ -1,7 +1,7 @@
(function(){
'use strict';

function mdDataTableColumnDirective(ColumnAwareService){
function mdDataTableColumnDirective(ColumnAwareService, ColumnOptionProvider){
return {
restrict: 'E',
templateUrl: '/main/templates/mdDataTableColumn.html',
Expand All @@ -17,12 +17,12 @@
});

scope.getColumnClass = function(){
if(scope.alignRule === 'right'){
if(scope.alignRule === ColumnOptionProvider.ALIGN_RULE.ALIGN_RIGHT){
return 'rightAlignedColumn';
}else{
return 'leftAlignedColumn';
}
}
};
}
};
}
Expand Down
@@ -1,7 +1,7 @@
(function(){
'use strict';

function mdDataTableRowPopulatorDirective(ColumnAwareService){
function mdDataTableRowPopulatorDirective(ColumnAwareService, ColumnOptionProvider){
return {
restrict: 'A',
templateUrl: '/main/templates/mdDataTableRowPopulator.html',
Expand All @@ -12,11 +12,11 @@
var columnOptionsList = ColumnAwareService.getAll();

scope.columnClassesList = _.map(columnOptionsList, function(options){
if(options.alignRule === 'left'){
return 'leftAlignedColumn';
if(options.alignRule === ColumnOptionProvider.ALIGN_RULE.ALIGN_RIGHT){
return 'rightAlignedColumn';
}

return 'rightAlignedColumn';
return 'leftAlignedColumn';
});
}
};
Expand Down
12 changes: 12 additions & 0 deletions app/modules/main/providers/ColumnOptionsProvider.js
@@ -0,0 +1,12 @@
(function(){

var ColumnOptionProvider = {
ALIGN_RULE : {
ALIGN_LEFT: 'left',
ALIGN_RIGHT: 'right'
}
};

angular.module('mdDataTable')
.value('ColumnOptionProvider', ColumnOptionProvider);
})();

0 comments on commit 2d8c089

Please sign in to comment.