},
components: [
{kind: "Header", content: "Preferences"},
- {kind: "Scroller", flex: 1, horizontal: false, components: [
- {kind: "VFlexBox", align: "center", components: [
- {kind: "RowGroup", name: "prefsContainer", style: "width: 750px"}
+ {kind: "Scroller", flex: 1, components: [
+ {kind: "Control", className: "prefs-center", components: [
+ {kind: "RowGroup", name: "prefsContainer"},
+ {kind: "HFlexBox", pack: "center", components: [
+ {kind: "Button", className: "enyo-button-negative prefs-done-button", caption: "Reset to Defaults", onclick: "resetToDefaults"}
+ ]}
]}
]},
{kind: "Toolbar", className: "enyo-toolbar-light", components: [
case 'Slider':
c = this.$.prefsContainer.createComponent({kind: "HFlexBox", align: "center", components: [{content: p.label, flex: 1}]});
var slider = c.createComponent(p, {owner: this.$.prefsContainer});
- slider.setStyle('width: 400px');
slider.setPosition(values[p.name]);
break;
default:
}
this.doClose(o);
+ this.cleanup();
+ },
+ resetToDefaults: function() {
+ this.doClose(null);
+ this.cleanup();
+ },
+ cleanup: function() {
var controls = this.$.prefsContainer.getControls();
for (var i = 0; i < controls.length; i++) {
// We destroy the parent because we want to destroy the