diff --git a/src/layers/layers.ts b/src/layers/layers.ts index f447f11d..038d2125 100644 --- a/src/layers/layers.ts +++ b/src/layers/layers.ts @@ -3,7 +3,7 @@ * Licensed under MIT License. See License.txt in the project root for license information */ import { Node } from "../common/node"; -import { PropertyBoolean } from "../common/props"; +import { PropertyBoolean, PropertyStringSelectable } from "../common/props"; /** * Accessibility layers. @@ -11,6 +11,10 @@ import { PropertyBoolean } from "../common/props"; */ export class Layers extends Node { + public static readonly DT_DESKTOP = "desktop"; + public static readonly DT_TABLET = "tablet"; + public static readonly DT_MOBILE = "mobile"; + /** Color blind property */ public readonly colorBlind: PropertyBoolean; /** Dyslexia property */ @@ -19,6 +23,8 @@ export class Layers extends Node { public readonly motionSensitivity: PropertyBoolean; /** All accessbility layer properties */ public readonly properties: PropertyBoolean[]; + /** The device target property */ + public readonly deviceTarget: PropertyStringSelectable; constructor(parent: Node) { super("layers", parent); @@ -26,6 +32,10 @@ export class Layers extends Node { this.dyslexia = new PropertyBoolean("Dyslexia", false, this, {defaultValue: false}); this.motionSensitivity = new PropertyBoolean("Motion Sensitivity", false, this, {defaultValue: false}); this.properties = [this.colorBlind, this.dyslexia, this.motionSensitivity]; + this.deviceTarget = new PropertyStringSelectable("Devices", true, this, { + selectables: [Layers.DT_DESKTOP, Layers.DT_TABLET, Layers.DT_MOBILE], + defaultValue: Layers.DT_DESKTOP, + }); } public deserialize(obj: any) { @@ -34,6 +44,7 @@ export class Layers extends Node { this.colorBlind.deserialize(obj.colorBlind); this.dyslexia.deserialize(obj.dyslexia); this.motionSensitivity.deserialize(obj.motionSensitivity); + this.deviceTarget.deserialize(obj.deviceTarget); } public serialize(): any { @@ -41,6 +52,7 @@ export class Layers extends Node { obj.colorBlind = this.colorBlind.serialize(); obj.dyslexia = this.dyslexia.serialize(); obj.motionSensitivity = this.motionSensitivity.serialize(); + obj.deviceTarget = this.deviceTarget.serialize(); return obj; } } \ No newline at end of file