Added customized className for rows

This commit is contained in:
flocculus-admin 2019-07-30 10:41:39 -07:00
parent 096993eb6e
commit 7d8ec1a98f
7 changed files with 507 additions and 492 deletions

View File

@ -186,7 +186,7 @@ var Common = {
return obj === false || obj === true;
},
isFunction: function isFunction(obj) {
return Object.prototype.toString.call(obj) === '[object Function]';
return obj instanceof Function;
}
};
@ -684,8 +684,9 @@ Object.defineProperty(Color.prototype, 'a', {
});
Object.defineProperty(Color.prototype, 'hex', {
get: function get$$1() {
if (!this.__state.space !== 'HEX') {
if (this.__state.space !== 'HEX') {
this.__state.hex = ColorMath.rgb_to_hex(this.r, this.g, this.b);
this.__state.space = 'HEX';
}
return this.__state.hex;
},
@ -2322,6 +2323,9 @@ function _add(gui, object, property, params) {
container.appendChild(controller.domElement);
var li = addRow(gui, container, params.before);
dom.addClass(li, GUI.CLASS_CONTROLLER_ROW);
if (object.className) {
dom.addClass(li, object.className);
}
if (controller instanceof ColorController) {
dom.addClass(li, 'color');
} else {

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -180,7 +180,7 @@ var Common = {
return obj === false || obj === true;
},
isFunction: function isFunction(obj) {
return Object.prototype.toString.call(obj) === '[object Function]';
return obj instanceof Function;
}
};
@ -678,8 +678,9 @@ Object.defineProperty(Color.prototype, 'a', {
});
Object.defineProperty(Color.prototype, 'hex', {
get: function get$$1() {
if (!this.__state.space !== 'HEX') {
if (this.__state.space !== 'HEX') {
this.__state.hex = ColorMath.rgb_to_hex(this.r, this.g, this.b);
this.__state.space = 'HEX';
}
return this.__state.hex;
},
@ -2316,6 +2317,9 @@ function _add(gui, object, property, params) {
container.appendChild(controller.domElement);
var li = addRow(gui, container, params.before);
dom.addClass(li, GUI.CLASS_CONTROLLER_ROW);
if (object.className) {
dom.addClass(li, object.className);
}
if (controller instanceof ColorController) {
dom.addClass(li, 'color');
} else {

File diff suppressed because one or more lines are too long

4
package-lock.json generated
View File

@ -77,6 +77,7 @@
"resolved": "https://registry.npmjs.org/align-text/-/align-text-0.1.4.tgz",
"integrity": "sha1-DNkKVhCT810KmSVsIrcGlDP60Rc=",
"dev": true,
"optional": true,
"requires": {
"kind-of": "^3.0.2",
"longest": "^1.0.1",
@ -3496,7 +3497,8 @@
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/longest/-/longest-1.0.1.tgz",
"integrity": "sha1-MKCy2jj3N3DoKUoNIuZiXtd9AJc=",
"dev": true
"dev": true,
"optional": true
},
"loose-envify": {
"version": "1.3.1",

View File

@ -1163,6 +1163,11 @@ function add(gui, object, property, params) {
const li = addRow(gui, container, params.before);
dom.addClass(li, GUI.CLASS_CONTROLLER_ROW);
if (object.className) {
dom.addClass(li, object.className);
}
if (controller instanceof ColorController) {
dom.addClass(li, 'color');
} else {