source: imaps-frontend/node_modules/inline-style-prefixer/lib/plugins/flexboxOld.js@ d565449

main
Last change on this file since d565449 was d565449, checked in by stefan toskovski <stefantoska84@…>, 4 weeks ago

Update repo after prototype presentation

  • Property mode set to 100644
File size: 988 bytes
Line 
1'use strict';
2
3Object.defineProperty(exports, "__esModule", {
4 value: true
5});
6exports.default = flexboxOld;
7var alternativeValues = {
8 'space-around': 'justify',
9 'space-between': 'justify',
10 'flex-start': 'start',
11 'flex-end': 'end',
12 'wrap-reverse': 'multiple',
13 wrap: 'multiple'
14};
15
16var alternativeProps = {
17 alignItems: 'WebkitBoxAlign',
18 justifyContent: 'WebkitBoxPack',
19 flexWrap: 'WebkitBoxLines',
20 flexGrow: 'WebkitBoxFlex'
21};
22
23function flexboxOld(property, value, style) {
24 if (property === 'flexDirection' && typeof value === 'string') {
25 if (value.indexOf('column') > -1) {
26 style.WebkitBoxOrient = 'vertical';
27 } else {
28 style.WebkitBoxOrient = 'horizontal';
29 }
30 if (value.indexOf('reverse') > -1) {
31 style.WebkitBoxDirection = 'reverse';
32 } else {
33 style.WebkitBoxDirection = 'normal';
34 }
35 }
36 if (alternativeProps.hasOwnProperty(property)) {
37 style[alternativeProps[property]] = alternativeValues[value] || value;
38 }
39}
Note: See TracBrowser for help on using the repository browser.