MCPcopy Index your code
hub / github.com/PixelsCommander/HTML-GL / augmentController

Function augmentController

page/js/dat.gui.js:2363–2514  ·  view source on GitHub ↗
(gui, li, controller)

Source from the content-addressed store, hash-verified

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

Callers 1

addFunction · 0.85

Calls 2

addFunction · 0.85
markPresetModifiedFunction · 0.85

Tested by

no test coverage detected