Update documentation
This commit is contained in:
parent
5adf77a193
commit
bb699e1473
|
@ -233,16 +233,15 @@ Constructs a new JSONEditor.
|
|||
a JSON field or value.
|
||||
|
||||
In case of field event, node information will be
|
||||
`{field: String, path: [{name: String, type: String}]}`.
|
||||
`{field: string, path: {string|number}[]}`.
|
||||
In case of value event, node information will be
|
||||
`{field: String, path: [{name: String, type: String}], value: String}`
|
||||
`{field: string, path: {string|number}[], value: string}`
|
||||
|
||||
signature should be:
|
||||
```js
|
||||
/**
|
||||
* @param {Node} the Node where event has been triggered
|
||||
identified by {field: String, path: [{name: String, type: String}] [,
|
||||
value: String]}`
|
||||
identified by {field: string, path: {string|number}[] [, value: string]}`
|
||||
* @param {event} the event fired
|
||||
*/
|
||||
function onEvent(node, event) {
|
||||
|
|
|
@ -90,7 +90,8 @@ Node.prototype._updateEditability = function () {
|
|||
|
||||
/**
|
||||
* Get the path of this node
|
||||
* @return {String[]} Array containing the path to this node
|
||||
* @return {{string|number}[]} Array containing the path to this node.
|
||||
* Element is a number if is the index of an array, a string otherwise.
|
||||
*/
|
||||
Node.prototype.getPath = function () {
|
||||
var node = this;
|
||||
|
@ -2378,6 +2379,11 @@ Node.prototype.onEvent = function (event) {
|
|||
node = this,
|
||||
expandable = this._hasChilds();
|
||||
|
||||
|
||||
if (typeof this.editor.options.onEvent === 'function') {
|
||||
this._onEvent(event);
|
||||
}
|
||||
|
||||
// check if mouse is on menu or on dragarea.
|
||||
// If so, highlight current row and its childs
|
||||
if (target == dom.drag || target == dom.menu) {
|
||||
|
@ -2550,10 +2556,6 @@ Node.prototype.onEvent = function (event) {
|
|||
if (type == 'keydown') {
|
||||
this.onKeyDown(event);
|
||||
}
|
||||
|
||||
if (typeof this.editor.options.onEvent === 'function') {
|
||||
this._onEvent(event);
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -2561,7 +2563,7 @@ Node.prototype.onEvent = function (event) {
|
|||
* value.
|
||||
* Information provided depends on the element, value is only included if
|
||||
* event occurs in a JSON value:
|
||||
* {field: String, path: [{name: String, type: String}] [, value: String]}
|
||||
* {field: string, path: {string|number}[] [, value: string]}
|
||||
* @param {Event} event
|
||||
* @private
|
||||
*/
|
||||
|
|
Loading…
Reference in New Issue