diff --git a/HISTORY.md b/HISTORY.md index 705574b..c6c31b1 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -3,6 +3,11 @@ https://github.com/josdejong/jsoneditor +## 2018-08-29, version 5.24.3 + +- Fixed color picker not working in ES6 projects. + + ## 2018-08-27, version 5.24.2 - Improved error and validation messaging in `text` mode. diff --git a/src/js/vanilla-picker/index.js b/src/js/vanilla-picker/index.js index 012a30f..b0daecc 100644 --- a/src/js/vanilla-picker/index.js +++ b/src/js/vanilla-picker/index.js @@ -1,13 +1,16 @@ -var VanillaPicker +var VanillaPicker; if (window.Picker) { // use the already loaded instance of VanillaPicker - VanillaPicker = window.Picker + VanillaPicker = window.Picker; } else { try { - // load brace - VanillaPicker = require('vanilla-picker'); + // load color picker + // Note that we load the ES5 distribution bundle + // instead of the "default" as the default currently + // points to `src/picker.js` which is ES6 code (v2.3.0). + VanillaPicker = require('vanilla-picker/dist/vanilla-picker'); } catch (err) { // probably running the minimalist bundle