forked from muicss/mui
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcol.js
More file actions
29 lines (29 loc) · 897 Bytes
/
col.js
File metadata and controls
29 lines (29 loc) · 897 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
module.exports = angular.module('mui.col', [])
.directive('muiCol', function() {
return {
restrict: 'AE',
scope: true,
replace: true,
template: '<div></div>',
transclude: true,
link: function(scope, element, attrs, controller, linker) {
linker(scope, function(clone) {
element.append(clone);
});
var breakpoints = {
'xs': 'mui-col-xs-',
'sm': 'mui-col-sm-',
'md': 'mui-col-md-',
'lg': 'mui-col-lg-',
'xs-offset': 'mui-col-xs-offset-',
'sm-offset': 'mui-col-sm-offset-',
'md-offset': 'mui-col-md-offset-',
'lg-offset': 'mui-col-lg-offset-'
};
angular.forEach(breakpoints, function(value, key) {
var temp = attrs[attrs.$normalize(key)];
temp && element.addClass(value + temp);
})
}
}
})