caption for SliceSelector
authorScott Baker <smbaker@gmail.com>
Wed, 14 Jan 2015 00:24:05 +0000 (16:24 -0800)
committerScott Baker <smbaker@gmail.com>
Wed, 14 Jan 2015 00:24:05 +0000 (16:24 -0800)
planetstack/core/xoslib/static/js/xoslib/xosHelper.js
planetstack/core/xoslib/templates/xosAdmin.html

index e8c1b10..07ae9a9 100644 (file)
@@ -20,6 +20,7 @@ SliceSelectorView = Marionette.CompositeView.extend({
     template: "#xos-sliceselector-select",
     childViewContainer: "select",
     childView: SliceSelectorOption,
+    caption: "Slice",
 
     events: {"change select": "onSliceChanged"},
 
@@ -34,6 +35,8 @@ SliceSelectorView = Marionette.CompositeView.extend({
     sliceChanged: function(id) {
         console.log("sliceChanged " + id);
     },
+
+    templateHelpers: function() { return {caption: this.options.caption || this.caption }; },
 });
 
 FilteredCompositeView = Marionette.CompositeView.extend( {
index c155848..574684b 100644 (file)
 </script>
 
 <script type="text/template" id="xos-sliceselector-select">
-    <select>
-    </select>
+    <% if (caption) { %>
+    <table><tr><td><%= caption %>: </td><td><select></select></td></tr></table>
+    <% } else { %>
+    <select></select>
+    <% } %>
 </script>
 
 <script>