1
0
mirror of https://github.com/ascribe/onion.git synced 2025-02-14 21:10:27 +01:00
onion/js/mixins/table_column_mixin.js
2015-05-20 14:48:57 +02:00

16 lines
482 B
JavaScript

import GeneralUtils from '../utils/general_utils';
let TableColumnMixin = {
/**
* Generates the bootstrap grid column declarations automatically using
* the columnMap.
*/
calcColumnClasses(obj) {
let bootstrapClasses = ['col-xs-', 'col-sm-', 'col-md-', 'col-lg-'];
let numOfColumns = GeneralUtils.valuesOfObject(obj).length;
return bootstrapClasses.join( numOfColumns + ' ') + numOfColumns;
}
};
export default TableColumnMixin;