X-Git-Url: http://git.bytex64.net/?a=blobdiff_plain;f=HackPreferences.js;h=550dbc1a38a5cab4b6e696d2b20b1517af8f4281;hb=d461d034b2d6a7774d71e7ea828d7b06c15e7d6b;hp=a8f91950d8c34b47ac20f524167cc3790ce3ac54;hpb=98d8bc4d5f0bc0b315b54369a8f288d93e9b2c44;p=Hacks.git diff --git a/HackPreferences.js b/HackPreferences.js index a8f9195..550dbc1 100644 --- a/HackPreferences.js +++ b/HackPreferences.js @@ -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