From f1a8e84a93fb0275d9e71b22855bd43c77b8b2a3 Mon Sep 17 00:00:00 2001 From: Victor Woeltjen Date: Fri, 20 Feb 2015 11:53:50 -0800 Subject: [PATCH] [Fixed Position] Allow adding elements Allow adding of elements (without any element-specific properties beyond type.) WTD-880. --- .../features/layout/res/templates/elements/box.html | 4 +++- .../features/layout/res/templates/elements/line.html | 3 ++- .../features/layout/res/templates/elements/text.html | 3 ++- platform/features/layout/src/FixedProxy.js | 9 ++++++++- .../features/layout/src/elements/ElementProxies.js | 10 +++++++--- 5 files changed, 22 insertions(+), 7 deletions(-) diff --git a/platform/features/layout/res/templates/elements/box.html b/platform/features/layout/res/templates/elements/box.html index 88a6987b29..eab7cf0af5 100644 --- a/platform/features/layout/res/templates/elements/box.html +++ b/platform/features/layout/res/templates/elements/box.html @@ -1,2 +1,4 @@ -
+
+ ???
\ No newline at end of file diff --git a/platform/features/layout/res/templates/elements/line.html b/platform/features/layout/res/templates/elements/line.html index 27eb74fc3d..2556056434 100644 --- a/platform/features/layout/res/templates/elements/line.html +++ b/platform/features/layout/res/templates/elements/line.html @@ -1,3 +1,4 @@ -
+
...line...
\ No newline at end of file diff --git a/platform/features/layout/res/templates/elements/text.html b/platform/features/layout/res/templates/elements/text.html index 4cdc956360..e41d20b639 100644 --- a/platform/features/layout/res/templates/elements/text.html +++ b/platform/features/layout/res/templates/elements/text.html @@ -1,3 +1,4 @@ -
+
{{ngModel.text}}
\ No newline at end of file diff --git a/platform/features/layout/src/FixedProxy.js b/platform/features/layout/src/FixedProxy.js index c99a0e3f92..eb23079d35 100644 --- a/platform/features/layout/src/FixedProxy.js +++ b/platform/features/layout/src/FixedProxy.js @@ -16,7 +16,14 @@ define( * Add a new visual element to this view. */ add: function (type) { - window.alert("Placeholder. Should add a " + type + "."); + configuration.elements = configuration.elements || []; + configuration.elements.push({ + x: configuration.elements.length, + y: configuration.elements.length, + width: 2, + height: 1, + type: type + }); } }; } diff --git a/platform/features/layout/src/elements/ElementProxies.js b/platform/features/layout/src/elements/ElementProxies.js index e8d6b032e5..297c62fb82 100644 --- a/platform/features/layout/src/elements/ElementProxies.js +++ b/platform/features/layout/src/elements/ElementProxies.js @@ -1,12 +1,16 @@ /*global define*/ define( - ['./TelemetryProxy'], - function (TelemetryProxy) { + ['./TelemetryProxy', './ElementProxy'], + function (TelemetryProxy, ElementProxy) { "use strict"; return { - "fixed.telemetry": TelemetryProxy + "fixed.telemetry": TelemetryProxy, + "fixed.line": ElementProxy, + "fixed.box": ElementProxy, + "fixed.image": ElementProxy, + "fixed.text": ElementProxy }; } ); \ No newline at end of file