diff --git a/lib/network/Network.js b/lib/network/Network.js index 2c56c649..8440a0b1 100644 --- a/lib/network/Network.js +++ b/lib/network/Network.js @@ -24,10 +24,10 @@ import InteractionHandler from './modules/InteractionHandler'; import SelectionHandler from "./modules/SelectionHandler"; import LayoutEngine from "./modules/LayoutEngine"; import ManipulationSystem from "./modules/ManipulationSystem"; -import ConfigurationSystem from "./modules/ConfigurationSystem"; -import Validator from "./modules/Validator"; -import {printStyle} from "./modules/Validator"; -import {allOptions, configureOptions} from './modules/components/AllOptions.js'; +import ConfigurationSystem from "./../shared/ConfigurationSystem"; +import Validator from "./../shared/Validator"; +import {printStyle} from "./../shared/Validator"; +import {allOptions, configureOptions} from './options.js'; @@ -146,8 +146,7 @@ Network.prototype.setOptions = function (options) { let errorFound = Validator.validate(options, allOptions); if (errorFound === true) { - options = {}; - console.log('%cErrors have been found in the supplied options object. None of the options will be used.', printStyle); + console.log('%cErrors have been found in the supplied options object.', printStyle); } // copy the global fields over diff --git a/lib/network/modules/components/Node.js b/lib/network/modules/components/Node.js index ce39e65a..336ec215 100644 --- a/lib/network/modules/components/Node.js +++ b/lib/network/modules/components/Node.js @@ -16,8 +16,8 @@ import Star from './nodes/shapes/Star' import Text from './nodes/shapes/Text' import Triangle from './nodes/shapes/Triangle' import TriangleDown from './nodes/shapes/TriangleDown' -import Validator from "../Validator"; -import {printStyle} from "../Validator"; +import Validator from "../../../shared/Validator"; +import {printStyle} from "../../../shared/Validator"; /** diff --git a/lib/network/modules/components/AllOptions.js b/lib/network/options.js similarity index 100% rename from lib/network/modules/components/AllOptions.js rename to lib/network/options.js diff --git a/lib/network/modules/ConfigurationSystem.js b/lib/shared/ConfigurationSystem.js similarity index 99% rename from lib/network/modules/ConfigurationSystem.js rename to lib/shared/ConfigurationSystem.js index b48d5124..c50e87c9 100644 --- a/lib/network/modules/ConfigurationSystem.js +++ b/lib/shared/ConfigurationSystem.js @@ -1,6 +1,6 @@ -var util = require('../../util'); +var util = require('../util'); -import ColorPicker from './components/ColorPicker' +import ColorPicker from './../network/modules/components/ColorPicker' /** * The way this works is for all properties of this.possible options, you can supply the property name in any form to list the options. diff --git a/lib/network/modules/Validator.js b/lib/shared/Validator.js similarity index 99% rename from lib/network/modules/Validator.js rename to lib/shared/Validator.js index 0479ccbc..57b1b2ab 100644 --- a/lib/network/modules/Validator.js +++ b/lib/shared/Validator.js @@ -1,4 +1,4 @@ -var util = require('../../util'); +var util = require('../util'); let errorFound = false; let allOptions; diff --git a/lib/timeline/Timeline.js b/lib/timeline/Timeline.js index e61b73f6..905226b4 100644 --- a/lib/timeline/Timeline.js +++ b/lib/timeline/Timeline.js @@ -10,9 +10,9 @@ var CurrentTime = require('./component/CurrentTime'); var CustomTime = require('./component/CustomTime'); var ItemSet = require('./component/ItemSet'); -var ConfigurationSystem = require('../network/modules/ConfigurationSystem'); -var Validator = require('../network/modules/Validator').default; -var printStyle = require('../network/modules/Validator').printStyle; +var ConfigurationSystem = require('../shared/ConfigurationSystem'); +var Validator = require('../shared/Validator').default; +var printStyle = require('../shared/Validator').printStyle; var allOptions = require('./options').allOptions; var configureOptions = require('./options').configureOptions; @@ -156,8 +156,7 @@ Timeline.prototype.setOptions = function (options) { // validate options let errorFound = Validator.validate(options, allOptions); if (errorFound === true) { - options = {}; - console.log('%cErrors have been found in the supplied options object. None of the options will be used.', printStyle); + console.log('%cErrors have been found in the supplied options object.', printStyle); } Core.prototype.setOptions.call(this, options);