123456789101112131415161718192021 |
- function getDirection(primaryButtonText, secondaryButtonText, cancelButtonText, type) {
-
- if (!primaryButtonText && !secondaryButtonText && !cancelButtonText) {
- return '';
- }
-
- if ([primaryButtonText, secondaryButtonText, cancelButtonText].filter(function (v) {
- return !!v;
- }).length === 1) {
- return 'vertical';
- }
-
- if (primaryButtonText && secondaryButtonText && cancelButtonText) {
- return 'vertical';
- }
-
- return type === 'focus' ? 'vertical' : 'horizontal';
- }
- export default {
- getDirection: getDirection
- };
|