# All files / scripts/CDP/Framework Orientation.ts

75% Statements 6/8
50% Branches 4/8
75% Functions 3/4
71.43% Lines 5/7

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    211x

    1x
    1x
    1x

    1x

     ﻿namespace CDP.Framework {

        /**
         * @en Orientation code
         * @ja orientation 識別子
         */
        export enum Orientation {
            PORTRAIT = 0,
            LANDSCAPE = 1,
        }

        /**
         * @en Get Orientation enum code
         * @ja Orientation の取得
         */
        export function getOrientation(): Orientation {
            const $window = $(window);
            return ($window.width() < $window.height()) ? Orientation.PORTRAIT : Orientation.LANDSCAPE;
        }
    }