mirror of
https://github.com/dataarts/dat.gui.git
synced 2024-12-12 04:08:27 +00:00
Added customized className for rows
This commit is contained in:
parent
096993eb6e
commit
7d8ec1a98f
@ -186,7 +186,7 @@ var Common = {
|
|||||||
return obj === false || obj === true;
|
return obj === false || obj === true;
|
||||||
},
|
},
|
||||||
isFunction: function isFunction(obj) {
|
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', {
|
Object.defineProperty(Color.prototype, 'hex', {
|
||||||
get: function get$$1() {
|
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.hex = ColorMath.rgb_to_hex(this.r, this.g, this.b);
|
||||||
|
this.__state.space = 'HEX';
|
||||||
}
|
}
|
||||||
return this.__state.hex;
|
return this.__state.hex;
|
||||||
},
|
},
|
||||||
@ -2322,6 +2323,9 @@ function _add(gui, object, property, params) {
|
|||||||
container.appendChild(controller.domElement);
|
container.appendChild(controller.domElement);
|
||||||
var li = addRow(gui, container, params.before);
|
var li = addRow(gui, container, params.before);
|
||||||
dom.addClass(li, GUI.CLASS_CONTROLLER_ROW);
|
dom.addClass(li, GUI.CLASS_CONTROLLER_ROW);
|
||||||
|
if (object.className) {
|
||||||
|
dom.addClass(li, object.className);
|
||||||
|
}
|
||||||
if (controller instanceof ColorController) {
|
if (controller instanceof ColorController) {
|
||||||
dom.addClass(li, 'color');
|
dom.addClass(li, 'color');
|
||||||
} else {
|
} else {
|
||||||
|
File diff suppressed because one or more lines are too long
2
build/dat.gui.min.js
vendored
2
build/dat.gui.min.js
vendored
File diff suppressed because one or more lines are too long
@ -180,7 +180,7 @@ var Common = {
|
|||||||
return obj === false || obj === true;
|
return obj === false || obj === true;
|
||||||
},
|
},
|
||||||
isFunction: function isFunction(obj) {
|
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', {
|
Object.defineProperty(Color.prototype, 'hex', {
|
||||||
get: function get$$1() {
|
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.hex = ColorMath.rgb_to_hex(this.r, this.g, this.b);
|
||||||
|
this.__state.space = 'HEX';
|
||||||
}
|
}
|
||||||
return this.__state.hex;
|
return this.__state.hex;
|
||||||
},
|
},
|
||||||
@ -2316,6 +2317,9 @@ function _add(gui, object, property, params) {
|
|||||||
container.appendChild(controller.domElement);
|
container.appendChild(controller.domElement);
|
||||||
var li = addRow(gui, container, params.before);
|
var li = addRow(gui, container, params.before);
|
||||||
dom.addClass(li, GUI.CLASS_CONTROLLER_ROW);
|
dom.addClass(li, GUI.CLASS_CONTROLLER_ROW);
|
||||||
|
if (object.className) {
|
||||||
|
dom.addClass(li, object.className);
|
||||||
|
}
|
||||||
if (controller instanceof ColorController) {
|
if (controller instanceof ColorController) {
|
||||||
dom.addClass(li, 'color');
|
dom.addClass(li, 'color');
|
||||||
} else {
|
} else {
|
||||||
|
File diff suppressed because one or more lines are too long
4
package-lock.json
generated
4
package-lock.json
generated
@ -77,6 +77,7 @@
|
|||||||
"resolved": "https://registry.npmjs.org/align-text/-/align-text-0.1.4.tgz",
|
"resolved": "https://registry.npmjs.org/align-text/-/align-text-0.1.4.tgz",
|
||||||
"integrity": "sha1-DNkKVhCT810KmSVsIrcGlDP60Rc=",
|
"integrity": "sha1-DNkKVhCT810KmSVsIrcGlDP60Rc=",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
|
"optional": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"kind-of": "^3.0.2",
|
"kind-of": "^3.0.2",
|
||||||
"longest": "^1.0.1",
|
"longest": "^1.0.1",
|
||||||
@ -3496,7 +3497,8 @@
|
|||||||
"version": "1.0.1",
|
"version": "1.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/longest/-/longest-1.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/longest/-/longest-1.0.1.tgz",
|
||||||
"integrity": "sha1-MKCy2jj3N3DoKUoNIuZiXtd9AJc=",
|
"integrity": "sha1-MKCy2jj3N3DoKUoNIuZiXtd9AJc=",
|
||||||
"dev": true
|
"dev": true,
|
||||||
|
"optional": true
|
||||||
},
|
},
|
||||||
"loose-envify": {
|
"loose-envify": {
|
||||||
"version": "1.3.1",
|
"version": "1.3.1",
|
||||||
|
@ -1163,6 +1163,11 @@ function add(gui, object, property, params) {
|
|||||||
const li = addRow(gui, container, params.before);
|
const li = addRow(gui, container, params.before);
|
||||||
|
|
||||||
dom.addClass(li, GUI.CLASS_CONTROLLER_ROW);
|
dom.addClass(li, GUI.CLASS_CONTROLLER_ROW);
|
||||||
|
|
||||||
|
if (object.className) {
|
||||||
|
dom.addClass(li, object.className);
|
||||||
|
}
|
||||||
|
|
||||||
if (controller instanceof ColorController) {
|
if (controller instanceof ColorController) {
|
||||||
dom.addClass(li, 'color');
|
dom.addClass(li, 'color');
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user