2 name: "HackPreferences",
8 {kind: "Header", content: "Preferences"},
9 {kind: "Scroller", flex: 1, horizontal: false, components: [
10 {kind: "VFlexBox", align: "center", components: [
11 {kind: "RowGroup", name: "prefsContainer", style: "width: 750px"}
14 {kind: "Toolbar", className: "enyo-toolbar-light", components: [
15 {kind: "Button", content: "Done", onclick: "close", className: "enyo-button-affirmative prefs-done-button"}
18 load: function(name, prefs, values) {
19 this.$.prefsContainer.setCaption(name);
22 for (var i = 0; i < this.prefs.length; i++) {
23 var p = this.prefs[i];
28 c = this.$.prefsContainer.createComponent({kind: "HFlexBox", align: "center", components: [{content: p.label, flex: 1}]});
29 var slider = c.createComponent(p, {owner: this.$.prefsContainer});
30 slider.setStyle('width: 400px');
31 slider.setPosition(values[p.name]);
34 c = this.$.prefsContainer.createComponent(p, {owner: this.$.prefsContainer});
35 c.setValue(values[p.name]);
38 this.$.prefsContainer.render();
42 for (var i = 0; i < this.prefs.length; i++) {
43 var p = this.prefs[i];
48 v = this.$.prefsContainer.$[p.name].getPosition();
51 v = this.$.prefsContainer.$[p.name].getValue();
57 var controls = this.$.prefsContainer.getControls();
58 for (var i = 0; i < controls.length; i++) {
59 // We destroy the parent because we want to destroy the
60 // row client, as well. This is probably a bug in
62 controls[i].parent.destroy();
63 controls[i].destroy();