Merge remote-tracking branch 'genrich/patch-1'

This commit is contained in:
Tomas Korcak 2015-08-14 15:48:40 +02:00
commit f93d49b207
4 changed files with 73 additions and 58 deletions

View File

@ -42,6 +42,7 @@ 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.

View File

@ -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);
}
}; };
/***/ }, /***/ },

File diff suppressed because one or more lines are too long

View File

@ -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);
}
}; };