Browse Source

Added es5 to es6 transpilation step to the build script, so now we can use ES6 :)

flowchartTest
jos 9 years ago
parent
commit
7114d5ccc9
3 changed files with 10 additions and 11 deletions
  1. +5
    -2
      gulpfile.js
  2. +3
    -9
      lib/timeline/Core.js
  3. +2
    -0
      package.json

+ 5
- 2
gulpfile.js View File

@ -34,7 +34,6 @@ var bannerPlugin = new webpack.BannerPlugin(createBanner(), {
raw: true raw: true
}); });
// TODO: the moment.js language files should be excluded by default (they are quite big)
var webpackConfig = { var webpackConfig = {
entry: ENTRY, entry: ENTRY,
output: { output: {
@ -44,8 +43,12 @@ var webpackConfig = {
filename: VIS_JS, filename: VIS_JS,
sourcePrefix: ' ' sourcePrefix: ' '
}, },
// exclude requires of moment.js language files
module: { module: {
loaders: [
{ test: /\.js$/, exclude: /node_modules/, loader: '6to5-loader'}
],
// exclude requires of moment.js language files
wrappedContextRegExp: /$^/ wrappedContextRegExp: /$^/
}, },
plugins: [ bannerPlugin ], plugins: [ bannerPlugin ],

+ 3
- 9
lib/timeline/Core.js View File

@ -214,9 +214,7 @@ Core.prototype.setOptions = function (options) {
} }
// propagate options to all components // propagate options to all components
this.components.forEach(function (component) {
component.setOptions(options);
});
this.components.forEach(component => component.setOptions(options));
// TODO: remove deprecation error one day (deprecated since version 0.8.0) // TODO: remove deprecation error one day (deprecated since version 0.8.0)
if (options && options.order) { if (options && options.order) {
@ -270,9 +268,7 @@ Core.prototype.destroy = function () {
this.hammer = null; this.hammer = null;
// give all components the opportunity to cleanup // give all components the opportunity to cleanup
this.components.forEach(function (component) {
component.destroy();
});
this.components.forEach(component => component.destroy());
this.body = null; this.body = null;
}; };
@ -336,9 +332,7 @@ Core.prototype.clear = function(what) {
// clear options of timeline and of each of the components // clear options of timeline and of each of the components
if (!what || what.options) { if (!what || what.options) {
this.components.forEach(function (component) {
component.setOptions(component.defaultOptions);
});
this.components.forEach(component => component.setOptions(component.defaultOptions));
this.setOptions(this.defaultOptions); // this will also do a redraw this.setOptions(this.defaultOptions); // this will also do a redraw
} }

+ 2
- 0
package.json View File

@ -34,6 +34,8 @@
"keycharm": "^0.2.0" "keycharm": "^0.2.0"
}, },
"devDependencies": { "devDependencies": {
"6to5": "^2.12.2",
"6to5-loader": "^2.0.0",
"clean-css": "latest", "clean-css": "latest",
"gulp": "^3.8.5", "gulp": "^3.8.5",
"gulp-concat": "^2.2.0", "gulp-concat": "^2.2.0",

Loading…
Cancel
Save