[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>

View File

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

View File

@ -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
});
}
};
}

View File

@ -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
};
}
);