[Fixed Position] Allow adding elements

Allow adding of elements (without any element-specific
properties beyond type.) WTD-880.
This commit is contained in:
Victor Woeltjen
2015-02-20 11:53:50 -08:00
parent 6fca03521b
commit f1a8e84a93
5 changed files with 22 additions and 7 deletions

View File

@ -1,2 +1,4 @@
<div ng-style="{ background: ngModel.fill }"> <div ng-style="{ background: ngModel.fill }"
style="width: 100%; height: 100%;">
???
</div> </div>

View File

@ -1,3 +1,4 @@
<div ng-style="{ background: ngModel.fill }"> <div ng-style="{ background: ngModel.fill }"
style="width: 100%; height: 100%">
...line... ...line...
</div> </div>

View File

@ -1,3 +1,4 @@
<div ng-style="{ background: ngModel.fill }"> <div ng-style="{ background: ngModel.fill }"
style="width: 100%; height: 100%">
{{ngModel.text}} {{ngModel.text}}
</div> </div>

View File

@ -16,7 +16,14 @@ define(
* Add a new visual element to this view. * Add a new visual element to this view.
*/ */
add: function (type) { 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
});
} }
}; };
} }

View File

@ -1,12 +1,16 @@
/*global define*/ /*global define*/
define( define(
['./TelemetryProxy'], ['./TelemetryProxy', './ElementProxy'],
function (TelemetryProxy) { function (TelemetryProxy, ElementProxy) {
"use strict"; "use strict";
return { return {
"fixed.telemetry": TelemetryProxy "fixed.telemetry": TelemetryProxy,
"fixed.line": ElementProxy,
"fixed.box": ElementProxy,
"fixed.image": ElementProxy,
"fixed.text": ElementProxy
}; };
} }
); );