Update version to 1.2.0
[Hacks.git] / HackPreferences.js
index a8f9195..550dbc1 100644 (file)
@@ -6,9 +6,12 @@ enyo.kind({
        },
        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: [
@@ -27,7 +30,6 @@ enyo.kind({
                        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:
@@ -54,6 +56,13 @@ enyo.kind({
                }
                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