mirror of https://gitee.com/bigwinds/arangodb
fixed issue #2509, updated jsoneditor lib
This commit is contained in:
parent
e83c1dce26
commit
a1dacc3e29
Binary file not shown.
Before Width: | Height: | Size: 7.4 KiB |
File diff suppressed because it is too large
Load Diff
Binary file not shown.
Before Width: | Height: | Size: 14 KiB |
File diff suppressed because one or more lines are too long
|
@ -49,8 +49,17 @@
|
||||||
|
|
||||||
execute: function (callback, args) {
|
execute: function (callback, args) {
|
||||||
if (this.lastRoute === '#queries') {
|
if (this.lastRoute === '#queries') {
|
||||||
|
// cleanup input editors
|
||||||
|
this.queryView.removeInputEditors();
|
||||||
// cleanup old canvas elements
|
// cleanup old canvas elements
|
||||||
this.queryView.cleanupGraphs();
|
this.queryView.cleanupGraphs();
|
||||||
|
// cleanup old ace instances
|
||||||
|
this.queryView.removeResults();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.lastRoute) {
|
||||||
|
if (this.lastRoute.substr(0, 11) === '#collection' && this.lastRoute.split('/').length === 3) {
|
||||||
|
this.documentView.cleanupEditor();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.lastRoute === '#dasboard' || window.location.hash.substr(0, 5) === '#node') {
|
if (this.lastRoute === '#dasboard' || window.location.hash.substr(0, 5) === '#node') {
|
||||||
|
@ -66,6 +75,7 @@
|
||||||
this.loggerView.logTopicView.remove();
|
this.loggerView.logTopicView.remove();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
this.lastRoute = window.location.hash;
|
this.lastRoute = window.location.hash;
|
||||||
// this function executes before every route call
|
// this function executes before every route call
|
||||||
|
|
|
@ -207,13 +207,14 @@
|
||||||
|
|
||||||
var container = document.getElementById('documentEditor');
|
var container = document.getElementById('documentEditor');
|
||||||
var options = {
|
var options = {
|
||||||
change: function () {
|
onChange: function () {
|
||||||
self.jsonContentChanged();
|
self.jsonContentChanged();
|
||||||
},
|
},
|
||||||
search: true,
|
search: true,
|
||||||
mode: 'tree',
|
mode: 'tree',
|
||||||
modes: ['tree', 'code'],
|
modes: ['tree', 'code'],
|
||||||
iconlib: 'fontawesome4'
|
ace: window.ace
|
||||||
|
// iconlib: 'fontawesome4'
|
||||||
};
|
};
|
||||||
this.editor = new JSONEditor(container, options);
|
this.editor = new JSONEditor(container, options);
|
||||||
if (this.defaultMode) {
|
if (this.defaultMode) {
|
||||||
|
@ -223,6 +224,12 @@
|
||||||
return this;
|
return this;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
cleanupEditor: function () {
|
||||||
|
if (this.editor) {
|
||||||
|
this.editor.destroy();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
removeReadonlyKeys: function (object) {
|
removeReadonlyKeys: function (object) {
|
||||||
return _.omit(object, ['_key', '_id', '_from', '_to', '_rev']);
|
return _.omit(object, ['_key', '_id', '_from', '_to', '_rev']);
|
||||||
},
|
},
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
background-color: $c-white !important;
|
background-color: $c-white !important;
|
||||||
border: 0 solid $c-semi-transp !important;
|
border: 0 solid $c-semi-transp !important;
|
||||||
|
|
||||||
.menu {
|
.jsoneditor-menu {
|
||||||
background-color: $c-white !important;
|
background-color: $c-white !important;
|
||||||
border-bottom: 1px solid $c-c2grey !important;
|
border-bottom: 1px solid $c-c2grey !important;
|
||||||
border-left: 0 !important;
|
border-left: 0 !important;
|
||||||
|
@ -12,20 +12,83 @@
|
||||||
|
|
||||||
button {
|
button {
|
||||||
border: 0 !important;
|
border: 0 !important;
|
||||||
}
|
color: $c-black;
|
||||||
|
opacity: .4 !important;
|
||||||
|
|
||||||
button:hover {
|
&:hover {
|
||||||
background-color: $c-positive;
|
background-color: $c-positive;
|
||||||
color: $c-white;
|
color: $c-white !important;
|
||||||
|
cursor: pointer;
|
||||||
|
opacity: 1 !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&.jsoneditor-selected {
|
||||||
|
background-color: $c-positive !important;
|
||||||
|
color: $c-white !important;
|
||||||
|
opacity: 1 !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.search {
|
&.jsoneditor-undo,
|
||||||
|
&.jsoneditor-redo {
|
||||||
|
opacity: 1 !important;
|
||||||
|
}
|
||||||
|
|
||||||
.frame {
|
&.jsoneditor-format,
|
||||||
|
&.jsoneditor-expand-all,
|
||||||
|
&.jsoneditor-collapse-all,
|
||||||
|
&.jsoneditor-compact {
|
||||||
|
background-color: $c-black !important;
|
||||||
|
filter: invert(100%);
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
background-color: $c-positive !important;
|
||||||
|
color: $c-white !important;
|
||||||
|
filter: invert(0%);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.jsoneditor-modes {
|
||||||
|
button {
|
||||||
border: 0 !important;
|
border: 0 !important;
|
||||||
margin: 3px !important;
|
color: $c-black;
|
||||||
|
opacity: .4 !important;
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
background-color: $c-positive;
|
||||||
|
color: $c-white !important;
|
||||||
|
cursor: pointer;
|
||||||
|
opacity: 1 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
&.jsoneditor-selected {
|
||||||
|
background-color: $c-positive !important;
|
||||||
|
color: $c-white !important;
|
||||||
|
opacity: 1 !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.jsoneditor-search {
|
||||||
|
.jsoneditor-frame {
|
||||||
|
border: 0 !important;
|
||||||
|
margin-top: -1px !important;
|
||||||
|
|
||||||
|
button {
|
||||||
|
border-radius: 2px;
|
||||||
|
|
||||||
|
&.jsoneditor-refresh {
|
||||||
|
background-position: -96px -72px;
|
||||||
|
margin-right: -10px;
|
||||||
|
margin-top: 1px;
|
||||||
|
width: 25px;
|
||||||
|
}
|
||||||
|
|
||||||
|
&.jsoneditor-next {
|
||||||
|
margin-left: -10px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.refresh {
|
.refresh {
|
||||||
background-position: -96px -73px;
|
background-position: -96px -73px;
|
||||||
|
@ -38,8 +101,11 @@
|
||||||
margin-left: 15px;
|
margin-left: 15px;
|
||||||
margin-right: 15px;
|
margin-right: 15px;
|
||||||
margin-top: 0;
|
margin-top: 0;
|
||||||
}
|
|
||||||
|
|
||||||
|
&:focus {
|
||||||
|
border: 2px solid $c-positive !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.results {
|
.results {
|
||||||
|
|
Loading…
Reference in New Issue