Browse Source

Added text input to ConfigurationSystem, added support for moment data type

flowchartTest
jos 9 years ago
parent
commit
79127d43b3
2 changed files with 28 additions and 2 deletions
  1. +24
    -1
      lib/network/modules/ConfigurationSystem.js
  2. +4
    -1
      lib/network/modules/Validator.js

+ 24
- 1
lib/network/modules/ConfigurationSystem.js View File

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

+ 4
- 1
lib/network/modules/Validator.js View File

@ -141,7 +141,10 @@ class Validator {
return 'date'; return 'date';
} }
if (object.nodeType !== undefined) { if (object.nodeType !== undefined) {
return 'dom'
return 'dom';
}
if (object._isAMomentObject === true) {
return 'moment';
} }
return 'object'; return 'object';
} }

Loading…
Cancel
Save