Released v5.9.4

This commit is contained in:
jos 2017-08-20 20:40:08 +02:00
parent 9ee8700661
commit a0f317d1d6
8 changed files with 47 additions and 22 deletions

View File

@ -3,6 +3,11 @@
https://github.com/josdejong/jsoneditor https://github.com/josdejong/jsoneditor
## 2017-08-20, version 5.9.4
- Fixed #447: context menus not working in Shadow DOM. Thanks @tomalec.
## 2017-07-24, version 5.9.3 ## 2017-07-24, version 5.9.3
- Fixed broken multi-selection (regression). - Fixed broken multi-selection (regression).

View File

@ -24,8 +24,8 @@
* Copyright (c) 2011-2017 Jos de Jong, http://jsoneditoronline.org * Copyright (c) 2011-2017 Jos de Jong, http://jsoneditoronline.org
* *
* @author Jos de Jong, <wjosdejong@gmail.com> * @author Jos de Jong, <wjosdejong@gmail.com>
* @version 5.9.3 * @version 5.9.4
* @date 2017-07-24 * @date 2017-08-20
*/ */
(function webpackUniversalModuleDefinition(root, factory) { (function webpackUniversalModuleDefinition(root, factory) {
if(typeof exports === 'object' && typeof module === 'object') if(typeof exports === 'object' && typeof module === 'object')
@ -3681,6 +3681,14 @@ return /******/ (function(modules) { // webpackBootstrap
var util = __webpack_require__(4); var util = __webpack_require__(4);
/**
* Node.getRootNode shim
* @param {Node} node node to check
* @return {Node} node's rootNode or `window` if there is ShadowDOM is not supported.
*/
function getRootNode(node){
return node.getRootNode && node.getRootNode() || window;
}
/** /**
* A context menu * A context menu
* @param {Object[]} items Array containing the menu structure * @param {Object[]} items Array containing the menu structure
@ -3919,7 +3927,8 @@ return /******/ (function(modules) { // webpackBootstrap
// create and attach event listeners // create and attach event listeners
var me = this; var me = this;
var list = this.dom.list; var list = this.dom.list;
this.eventListeners.mousedown = util.addEventListener(window, 'mousedown', function (event) { var rootNode = getRootNode(list);
this.eventListeners.mousedown = util.addEventListener(rootNode, 'mousedown', function (event) {
// hide menu on click outside of the menu // hide menu on click outside of the menu
var target = event.target; var target = event.target;
if ((target != list) && !me._isChildOf(target, list)) { if ((target != list) && !me._isChildOf(target, list)) {
@ -3928,7 +3937,7 @@ return /******/ (function(modules) { // webpackBootstrap
event.preventDefault(); event.preventDefault();
} }
}); });
this.eventListeners.keydown = util.addEventListener(window, 'keydown', function (event) { this.eventListeners.keydown = util.addEventListener(rootNode, 'keydown', function (event) {
me._onKeyDown(event); me._onKeyDown(event);
}); });
@ -3959,11 +3968,12 @@ return /******/ (function(modules) { // webpackBootstrap
// remove all event listeners // remove all event listeners
// all event listeners are supposed to be attached to document. // all event listeners are supposed to be attached to document.
var rootNode = getRootNode(this.dom.list);
for (var name in this.eventListeners) { for (var name in this.eventListeners) {
if (this.eventListeners.hasOwnProperty(name)) { if (this.eventListeners.hasOwnProperty(name)) {
var fn = this.eventListeners[name]; var fn = this.eventListeners[name];
if (fn) { if (fn) {
util.removeEventListener(window, name, fn); util.removeEventListener(rootNode, name, fn);
} }
delete this.eventListeners[name]; delete this.eventListeners[name];
} }

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

20
dist/jsoneditor.js vendored
View File

@ -24,8 +24,8 @@
* Copyright (c) 2011-2017 Jos de Jong, http://jsoneditoronline.org * Copyright (c) 2011-2017 Jos de Jong, http://jsoneditoronline.org
* *
* @author Jos de Jong, <wjosdejong@gmail.com> * @author Jos de Jong, <wjosdejong@gmail.com>
* @version 5.9.3 * @version 5.9.4
* @date 2017-07-24 * @date 2017-08-20
*/ */
(function webpackUniversalModuleDefinition(root, factory) { (function webpackUniversalModuleDefinition(root, factory) {
if(typeof exports === 'object' && typeof module === 'object') if(typeof exports === 'object' && typeof module === 'object')
@ -11657,6 +11657,14 @@ return /******/ (function(modules) { // webpackBootstrap
var util = __webpack_require__(57); var util = __webpack_require__(57);
/**
* Node.getRootNode shim
* @param {Node} node node to check
* @return {Node} node's rootNode or `window` if there is ShadowDOM is not supported.
*/
function getRootNode(node){
return node.getRootNode && node.getRootNode() || window;
}
/** /**
* A context menu * A context menu
* @param {Object[]} items Array containing the menu structure * @param {Object[]} items Array containing the menu structure
@ -11895,7 +11903,8 @@ return /******/ (function(modules) { // webpackBootstrap
// create and attach event listeners // create and attach event listeners
var me = this; var me = this;
var list = this.dom.list; var list = this.dom.list;
this.eventListeners.mousedown = util.addEventListener(window, 'mousedown', function (event) { var rootNode = getRootNode(list);
this.eventListeners.mousedown = util.addEventListener(rootNode, 'mousedown', function (event) {
// hide menu on click outside of the menu // hide menu on click outside of the menu
var target = event.target; var target = event.target;
if ((target != list) && !me._isChildOf(target, list)) { if ((target != list) && !me._isChildOf(target, list)) {
@ -11904,7 +11913,7 @@ return /******/ (function(modules) { // webpackBootstrap
event.preventDefault(); event.preventDefault();
} }
}); });
this.eventListeners.keydown = util.addEventListener(window, 'keydown', function (event) { this.eventListeners.keydown = util.addEventListener(rootNode, 'keydown', function (event) {
me._onKeyDown(event); me._onKeyDown(event);
}); });
@ -11935,11 +11944,12 @@ return /******/ (function(modules) { // webpackBootstrap
// remove all event listeners // remove all event listeners
// all event listeners are supposed to be attached to document. // all event listeners are supposed to be attached to document.
var rootNode = getRootNode(this.dom.list);
for (var name in this.eventListeners) { for (var name in this.eventListeners) {
if (this.eventListeners.hasOwnProperty(name)) { if (this.eventListeners.hasOwnProperty(name)) {
var fn = this.eventListeners[name]; var fn = this.eventListeners[name];
if (fn) { if (fn) {
util.removeEventListener(window, name, fn); util.removeEventListener(rootNode, name, fn);
} }
delete this.eventListeners[name]; delete this.eventListeners[name];
} }

2
dist/jsoneditor.map vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,6 +1,6 @@
{ {
"name": "jsoneditor", "name": "jsoneditor",
"version": "5.9.3", "version": "5.9.4",
"main": "./index", "main": "./index",
"description": "A web-based tool to view, edit, format, and validate JSON", "description": "A web-based tool to view, edit, format, and validate JSON",
"tags": [ "tags": [