mirror of
https://github.com/niklasvh/html2canvas.git
synced 2023-08-10 21:13:10 +03:00
28 lines
551 B
JavaScript
28 lines
551 B
JavaScript
/* @flow */
|
|
'use strict';
|
|
|
|
export const POSITION = {
|
|
STATIC: 0,
|
|
RELATIVE: 1,
|
|
ABSOLUTE: 2,
|
|
FIXED: 3,
|
|
STICKY: 4
|
|
};
|
|
|
|
export type Position = $Values<typeof POSITION>;
|
|
|
|
export const parsePosition = (position: string): Position => {
|
|
switch (position) {
|
|
case 'relative':
|
|
return POSITION.RELATIVE;
|
|
case 'absolute':
|
|
return POSITION.ABSOLUTE;
|
|
case 'fixed':
|
|
return POSITION.FIXED;
|
|
case 'sticky':
|
|
return POSITION.STICKY;
|
|
}
|
|
|
|
return POSITION.STATIC;
|
|
};
|