mirror of
https://github.com/ascribe/onion.git
synced 2025-02-14 21:10:27 +01:00
16 lines
482 B
JavaScript
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; |