forked from dataarts/dat.gui
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CustomController.js
49 lines (46 loc) · 1.4 KB
/
CustomController.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
/**
* dat-gui JavaScript Controller Library
* http://code.google.com/p/dat-gui
*
* @author Andrej Hristoliubov https://anhr.github.io/AboutMe/
*
* Copyright 2011 Data Arts Team, Google Creative Lab
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*/
import Controller from './Controller';
import ControllerFactory from './ControllerFactory';
/**
* @class Represents a custom controller.
*
* @extends dat.controllers.Controller
*
*/
class CustomController extends Controller{
/**
* Represents a custom controller.
* @param {Object} object The object to be manipulated
* @param {Function} [object.property] Returns an object with elements for adding into "property-name" class element.
* @param {string} property The name of the property to be manipulated
* @param {Object} [params] Optional parameters
*/
constructor(object, property) {
super(object, property);
this.arguments = {
object: object, property: property, opts: Array.prototype.slice.call(arguments, 2)
}
if(object.property)
this.property = object.property( this );
}
set controller( newController ){
this._controller = newController;
}
get controller(){
return this._controller;
}
}
export default CustomController;