Skip to content

Commit

Permalink
Released v5.9.5
Browse files Browse the repository at this point in the history
  • Loading branch information
josdejong committed Aug 26, 2017
1 parent d5ba548 commit a418fba
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 24 deletions.
16 changes: 9 additions & 7 deletions dist/jsoneditor-minimalist.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
* Copyright (c) 2011-2017 Jos de Jong, http://jsoneditoronline.org
*
* @author Jos de Jong, <[email protected]>
* @version 5.9.4
* @date 2017-08-20
* @version 5.9.5
* @date 2017-08-26
*/
(function webpackUniversalModuleDefinition(root, factory) {
if(typeof exports === 'object' && typeof module === 'object')
Expand Down Expand Up @@ -3689,6 +3689,7 @@ return /******/ (function(modules) { // webpackBootstrap
function getRootNode(node){
return node.getRootNode && node.getRootNode() || window;
}

/**
* A context menu
* @param {Object[]} items Array containing the menu structure
Expand Down Expand Up @@ -3920,15 +3921,17 @@ return /******/ (function(modules) { // webpackBootstrap
this.dom.menu.style.bottom = '0px';
}

// find the root node of the page (window, or a shadow dom root element)
this.rootNode = getRootNode(anchor);

// attach the menu to the parent of the anchor
var parent = anchor.parentNode;
parent.insertBefore(this.dom.root, parent.firstChild);

// create and attach event listeners
var me = this;
var list = this.dom.list;
var rootNode = getRootNode(list);
this.eventListeners.mousedown = util.addEventListener(rootNode, 'mousedown', function (event) {
this.eventListeners.mousedown = util.addEventListener(this.rootNode, 'mousedown', function (event) {
// hide menu on click outside of the menu
var target = event.target;
if ((target != list) && !me._isChildOf(target, list)) {
Expand All @@ -3937,7 +3940,7 @@ return /******/ (function(modules) { // webpackBootstrap
event.preventDefault();
}
});
this.eventListeners.keydown = util.addEventListener(rootNode, 'keydown', function (event) {
this.eventListeners.keydown = util.addEventListener(this.rootNode, 'keydown', function (event) {
me._onKeyDown(event);
});

Expand Down Expand Up @@ -3968,12 +3971,11 @@ return /******/ (function(modules) { // webpackBootstrap

// remove all event listeners
// all event listeners are supposed to be attached to document.
var rootNode = getRootNode(this.dom.list);
for (var name in this.eventListeners) {
if (this.eventListeners.hasOwnProperty(name)) {
var fn = this.eventListeners[name];
if (fn) {
util.removeEventListener(rootNode, name, fn);
util.removeEventListener(this.rootNode, name, fn);
}
delete this.eventListeners[name];
}
Expand Down
2 changes: 1 addition & 1 deletion dist/jsoneditor-minimalist.map

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions dist/jsoneditor-minimalist.min.js

Large diffs are not rendered by default.

16 changes: 9 additions & 7 deletions dist/jsoneditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
* Copyright (c) 2011-2017 Jos de Jong, http://jsoneditoronline.org
*
* @author Jos de Jong, <[email protected]>
* @version 5.9.4
* @date 2017-08-20
* @version 5.9.5
* @date 2017-08-26
*/
(function webpackUniversalModuleDefinition(root, factory) {
if(typeof exports === 'object' && typeof module === 'object')
Expand Down Expand Up @@ -11665,6 +11665,7 @@ return /******/ (function(modules) { // webpackBootstrap
function getRootNode(node){
return node.getRootNode && node.getRootNode() || window;
}

/**
* A context menu
* @param {Object[]} items Array containing the menu structure
Expand Down Expand Up @@ -11896,15 +11897,17 @@ return /******/ (function(modules) { // webpackBootstrap
this.dom.menu.style.bottom = '0px';
}

// find the root node of the page (window, or a shadow dom root element)
this.rootNode = getRootNode(anchor);

// attach the menu to the parent of the anchor
var parent = anchor.parentNode;
parent.insertBefore(this.dom.root, parent.firstChild);

// create and attach event listeners
var me = this;
var list = this.dom.list;
var rootNode = getRootNode(list);
this.eventListeners.mousedown = util.addEventListener(rootNode, 'mousedown', function (event) {
this.eventListeners.mousedown = util.addEventListener(this.rootNode, 'mousedown', function (event) {
// hide menu on click outside of the menu
var target = event.target;
if ((target != list) && !me._isChildOf(target, list)) {
Expand All @@ -11913,7 +11916,7 @@ return /******/ (function(modules) { // webpackBootstrap
event.preventDefault();
}
});
this.eventListeners.keydown = util.addEventListener(rootNode, 'keydown', function (event) {
this.eventListeners.keydown = util.addEventListener(this.rootNode, 'keydown', function (event) {
me._onKeyDown(event);
});

Expand Down Expand Up @@ -11944,12 +11947,11 @@ return /******/ (function(modules) { // webpackBootstrap

// remove all event listeners
// all event listeners are supposed to be attached to document.
var rootNode = getRootNode(this.dom.list);
for (var name in this.eventListeners) {
if (this.eventListeners.hasOwnProperty(name)) {
var fn = this.eventListeners[name];
if (fn) {
util.removeEventListener(rootNode, name, fn);
util.removeEventListener(this.rootNode, name, fn);
}
delete this.eventListeners[name];
}
Expand Down
2 changes: 1 addition & 1 deletion dist/jsoneditor.map

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions dist/jsoneditor.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "jsoneditor",
"version": "5.9.4",
"version": "5.9.5",
"main": "./index",
"description": "A web-based tool to view, edit, format, and validate JSON",
"tags": [
Expand Down

0 comments on commit a418fba

Please sign in to comment.