MCPcopy Index your code
hub / github.com/stemkoski/stemkoski.github.com / augmentController

Function augmentController

MathBox/dat.gui.js:2361–2512  ·  view source on GitHub ↗
(gui, li, controller)

Source from the content-addressed store, hash-verified

2359 }
2360
2361 function augmentController(gui, li, controller) {
2362
2363 controller.__li = li;
2364 controller.__gui = gui;
2365
2366 common.extend(controller, {
2367
2368 options: function(options) {
2369
2370 if (arguments.length > 1) {
2371 controller.remove();
2372
2373 return add(
2374 gui,
2375 controller.object,
2376 controller.property,
2377 {
2378 before: controller.__li.nextElementSibling,
2379 factoryArgs: [common.toArray(arguments)]
2380 }
2381 );
2382
2383 }
2384
2385 if (common.isArray(options) || common.isObject(options)) {
2386 controller.remove();
2387
2388 return add(
2389 gui,
2390 controller.object,
2391 controller.property,
2392 {
2393 before: controller.__li.nextElementSibling,
2394 factoryArgs: [options]
2395 }
2396 );
2397
2398 }
2399
2400 },
2401
2402 name: function(v) {
2403 controller.__li.firstElementChild.firstElementChild.innerHTML = v;
2404 return controller;
2405 },
2406
2407 listen: function() {
2408 controller.__gui.listen(controller);
2409 return controller;
2410 },
2411
2412 remove: function() {
2413 controller.__gui.remove(controller);
2414 return controller;
2415 }
2416
2417 });
2418

Callers 1

addFunction · 0.85

Calls 2

markPresetModifiedFunction · 0.85
addFunction · 0.70

Tested by

no test coverage detected