From 83ea26f60b059a307c09cb0b827499a246e1fab2 Mon Sep 17 00:00:00 2001 From: satoru kimura Date: Mon, 1 Jun 2015 12:39:06 +0900 Subject: [PATCH] Updated a test code for dat-gui. --- dat-gui/dat-gui-tests.ts | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/dat-gui/dat-gui-tests.ts b/dat-gui/dat-gui-tests.ts index cd71e2471b..19b34dd43f 100644 --- a/dat-gui/dat-gui-tests.ts +++ b/dat-gui/dat-gui-tests.ts @@ -157,3 +157,19 @@ var FizzyText = function () { update(); } +// ------------ 11. Object Literal Tests +() => { + var obj = {a:1,b:1}; + var gui = new dat.GUI(); + var controller = gui.add(obj, 'maxSize', 0, 10); + + controller.onChange(function (value) { + // Fires on every change, drag, keypress, etc. + }); + + controller.onFinishChange(function (value) { + // Fires when a controller loses focus. + alert("The new value is " + value); + }); +} +