|
@ -347,6 +347,29 @@ class ConfigurationSystem { |
|
|
this._makeItem(path, label, checkbox); |
|
|
this._makeItem(path, label, checkbox); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* make a text input field for string options. |
|
|
|
|
|
* @param defaultValue |
|
|
|
|
|
* @param value |
|
|
|
|
|
* @param path |
|
|
|
|
|
* @private |
|
|
|
|
|
*/ |
|
|
|
|
|
_makeTextInput(defaultValue, value, path) { |
|
|
|
|
|
var checkbox = document.createElement('input'); |
|
|
|
|
|
checkbox.type = 'text'; |
|
|
|
|
|
checkbox.className = 'vis-network-configuration text'; |
|
|
|
|
|
checkbox.value = value; |
|
|
|
|
|
if (value !== defaultValue) { |
|
|
|
|
|
this.changedOptions.push({path:path, value:value}); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
let me = this; |
|
|
|
|
|
checkbox.onchange = function() {me._update(this.value, path)}; |
|
|
|
|
|
|
|
|
|
|
|
let label = this._makeLabel(path[path.length-1], path); |
|
|
|
|
|
this._makeItem(path, label, checkbox); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* make a color field with a color picker for color fields |
|
|
* make a color field with a color picker for color fields |
|
@ -418,7 +441,7 @@ class ConfigurationSystem { |
|
|
this._handleArray(item, value, newPath); |
|
|
this._handleArray(item, value, newPath); |
|
|
} |
|
|
} |
|
|
else if (typeof item === 'string') { |
|
|
else if (typeof item === 'string') { |
|
|
this._handleString(item, value, newPath); |
|
|
|
|
|
|
|
|
this._makeTextInput(item, value, newPath); |
|
|
} |
|
|
} |
|
|
else if (typeof item === 'boolean') { |
|
|
else if (typeof item === 'boolean') { |
|
|
this._makeCheckbox(item, value, newPath); |
|
|
this._makeCheckbox(item, value, newPath); |
|
|