mirror of
https://github.com/dataarts/dat.gui.git
synced 2024-12-12 04:08:27 +00:00
Merge remote-tracking branch 'genrich/patch-1'
This commit is contained in:
commit
f93d49b207
@ -42,7 +42,8 @@ This will create a namespaced, unminified build of dat.GUI at `build/dat.gui.mai
|
|||||||
* Using common.js
|
* Using common.js
|
||||||
* Using webpack for build
|
* Using webpack for build
|
||||||
* Fixed an issue with colors based on arrays - https://github.com/dataarts/dat.gui/pull/57
|
* Fixed an issue with colors based on arrays - https://github.com/dataarts/dat.gui/pull/57
|
||||||
|
* Update factory.js, Step param was not used - https://github.com/dataarts/dat.gui/pull/45
|
||||||
|
|
||||||
### 0.5
|
### 0.5
|
||||||
* Moved to requirejs for dependency management.
|
* Moved to requirejs for dependency management.
|
||||||
* Changed global namespace from *DAT* to *dat* (lowercase).
|
* Changed global namespace from *DAT* to *dat* (lowercase).
|
||||||
|
@ -4209,40 +4209,47 @@ return /******/ (function(modules) { // webpackBootstrap
|
|||||||
BooleanController = __webpack_require__(8),
|
BooleanController = __webpack_require__(8),
|
||||||
common = __webpack_require__(5);
|
common = __webpack_require__(5);
|
||||||
|
|
||||||
module.exports = function(object, property) {
|
module.exports = function (object, property) {
|
||||||
|
|
||||||
var initialValue = object[property];
|
var initialValue = object[property];
|
||||||
|
|
||||||
// Providing options?
|
// Providing options?
|
||||||
if (common.isArray(arguments[2]) || common.isObject(arguments[2])) {
|
if (common.isArray(arguments[2]) || common.isObject(arguments[2])) {
|
||||||
return new OptionController(object, property, arguments[2]);
|
return new OptionController(object, property, arguments[2]);
|
||||||
}
|
|
||||||
|
|
||||||
// Providing a map?
|
|
||||||
|
|
||||||
if (common.isNumber(initialValue)) {
|
|
||||||
|
|
||||||
if (common.isNumber(arguments[2]) && common.isNumber(arguments[3])) {
|
|
||||||
// Has min and max.
|
|
||||||
return new NumberControllerSlider(object, property, arguments[2], arguments[3]);
|
|
||||||
|
|
||||||
} else {
|
|
||||||
|
|
||||||
return new NumberControllerBox(object, property, { min: arguments[2], max: arguments[3] });
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (common.isString(initialValue)) {
|
// Providing a map?
|
||||||
return new StringController(object, property);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (common.isFunction(initialValue)) {
|
if (common.isNumber(initialValue)) {
|
||||||
return new FunctionController(object, property, '');
|
|
||||||
}
|
if (common.isNumber(arguments[2]) && common.isNumber(arguments[3])) {
|
||||||
|
|
||||||
|
// Has min and max.
|
||||||
|
if (common.isNumber(arguments[4])) // has step
|
||||||
|
return new NumberControllerSlider(object, property, arguments[2], arguments[3], arguments[4]);
|
||||||
|
else
|
||||||
|
return new NumberControllerSlider(object, property, arguments[2], arguments[3]);
|
||||||
|
|
||||||
|
} else {
|
||||||
|
|
||||||
|
return new NumberControllerBox(object, property, {min: arguments[2], max: arguments[3]});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
if (common.isString(initialValue)) {
|
||||||
|
return new StringController(object, property);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (common.isFunction(initialValue)) {
|
||||||
|
return new FunctionController(object, property, '');
|
||||||
|
}
|
||||||
|
|
||||||
|
if (common.isBoolean(initialValue)) {
|
||||||
|
return new BooleanController(object, property);
|
||||||
|
}
|
||||||
|
|
||||||
if (common.isBoolean(initialValue)) {
|
|
||||||
return new BooleanController(object, property);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/***/ },
|
/***/ },
|
||||||
|
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
@ -19,38 +19,45 @@ var OptionController = require('./OptionController'),
|
|||||||
BooleanController = require('./BooleanController'),
|
BooleanController = require('./BooleanController'),
|
||||||
common = require('../utils/common');
|
common = require('../utils/common');
|
||||||
|
|
||||||
module.exports = function(object, property) {
|
module.exports = function (object, property) {
|
||||||
|
|
||||||
var initialValue = object[property];
|
var initialValue = object[property];
|
||||||
|
|
||||||
// Providing options?
|
// Providing options?
|
||||||
if (common.isArray(arguments[2]) || common.isObject(arguments[2])) {
|
if (common.isArray(arguments[2]) || common.isObject(arguments[2])) {
|
||||||
return new OptionController(object, property, arguments[2]);
|
return new OptionController(object, property, arguments[2]);
|
||||||
}
|
|
||||||
|
|
||||||
// Providing a map?
|
|
||||||
|
|
||||||
if (common.isNumber(initialValue)) {
|
|
||||||
|
|
||||||
if (common.isNumber(arguments[2]) && common.isNumber(arguments[3])) {
|
|
||||||
// Has min and max.
|
|
||||||
return new NumberControllerSlider(object, property, arguments[2], arguments[3]);
|
|
||||||
|
|
||||||
} else {
|
|
||||||
|
|
||||||
return new NumberControllerBox(object, property, { min: arguments[2], max: arguments[3] });
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (common.isString(initialValue)) {
|
// Providing a map?
|
||||||
return new StringController(object, property);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (common.isFunction(initialValue)) {
|
if (common.isNumber(initialValue)) {
|
||||||
return new FunctionController(object, property, '');
|
|
||||||
}
|
if (common.isNumber(arguments[2]) && common.isNumber(arguments[3])) {
|
||||||
|
|
||||||
|
// Has min and max.
|
||||||
|
if (common.isNumber(arguments[4])) // has step
|
||||||
|
return new NumberControllerSlider(object, property, arguments[2], arguments[3], arguments[4]);
|
||||||
|
else
|
||||||
|
return new NumberControllerSlider(object, property, arguments[2], arguments[3]);
|
||||||
|
|
||||||
|
} else {
|
||||||
|
|
||||||
|
return new NumberControllerBox(object, property, {min: arguments[2], max: arguments[3]});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
if (common.isString(initialValue)) {
|
||||||
|
return new StringController(object, property);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (common.isFunction(initialValue)) {
|
||||||
|
return new FunctionController(object, property, '');
|
||||||
|
}
|
||||||
|
|
||||||
|
if (common.isBoolean(initialValue)) {
|
||||||
|
return new BooleanController(object, property);
|
||||||
|
}
|
||||||
|
|
||||||
if (common.isBoolean(initialValue)) {
|
|
||||||
return new BooleanController(object, property);
|
|
||||||
}
|
|
||||||
};
|
};
|
Loading…
Reference in New Issue
Block a user