diff --git a/controllers/controller.number.js b/controllers/controller.number.js index a98223a..b6cef94 100644 --- a/controllers/controller.number.js +++ b/controllers/controller.number.js @@ -114,6 +114,7 @@ var NumberController = function() { } else if (max != undefined && val >= max) { val = max; } + _this.setValue(val); numberField.value = roundToDecimal(_this.getValue(), 4); diff --git a/demo/demo.css b/demo/demo.css index 249401c..f4fb66b 100644 --- a/demo/demo.css +++ b/demo/demo.css @@ -8,11 +8,21 @@ body { padding: 0 20px 20px 20px; } +#container { +max-width: 530px; +} + h1, h2, h3, h4, h5, h6 { font-family: "Helvetica Neue", helvetica, arial, sans-serif; color: #222; } +hr { +border: 0; +height: 0; +border-top: 1px dotted #ccc; +} + h1 { font-size: 80px; font-weight: 800; @@ -68,7 +78,6 @@ pre { p, ul { font-size: 125%; - max-width: 530px; line-height: 18px; margin-bottom: 24px; } diff --git a/gui.js b/gui.js index 95a5ad5..03d3c8c 100644 --- a/gui.js +++ b/gui.js @@ -147,6 +147,4 @@ var GUI = new function() { open = false; } - - }; diff --git a/index.html b/index.html index 2981c69..dffb602 100644 --- a/index.html +++ b/index.html @@ -49,6 +49,7 @@
+<script type="text/javascript" src="demo/demo.js"></script> +<script type="text/javascript" src="demo/demo.js"></script> <script type="text/javascript"> window.onload = function() { @@ -79,14 +80,14 @@ window.onload = function() { GUI.add(fizzyText, "growthSpeed", 0.01, 1); GUI.add(fizzyText, "speed", 0.1, 2); - // Sliders with min, max and increment. + // Sliders with min, max and increment GUI.add(fizzyText, "noiseStrength", 10, 100, 5); // Boolean checkbox GUI.add(fizzyText, "displayOutline"); // Fires a function called "explode" - GUI.add(fizzyText, "explode").setName('Explode!'); // Specify a custom name. + GUI.add(fizzyText, "explode").setName("Explode!"); // Specify a custom name. }; @@ -96,8 +97,20 @@ window.onload = function() {
this.prop = value
.