mirror of https://gitee.com/bigwinds/arangodb
fixed event bug in document view
This commit is contained in:
parent
e1031e64f7
commit
db4cdfef6a
|
@ -655,12 +655,18 @@
|
|||
this.waitForInit(this.document.bind(this), colid, docid);
|
||||
return;
|
||||
}
|
||||
if (!this.documentView) {
|
||||
this.documentView = new window.DocumentView({
|
||||
collection: this.arangoDocumentStore
|
||||
});
|
||||
var mode;
|
||||
if (this.documentView) {
|
||||
if (this.documentView.defaultMode) {
|
||||
mode = this.documentView.defaultMode;
|
||||
}
|
||||
this.documentView.remove();
|
||||
}
|
||||
this.documentView = new window.DocumentView({
|
||||
collection: this.arangoDocumentStore
|
||||
});
|
||||
this.documentView.colid = colid;
|
||||
this.documentView.defaultMode = mode;
|
||||
|
||||
var doc = window.location.hash.split('/')[2];
|
||||
var test = (doc.split('%').length - 1) % 3;
|
||||
|
|
|
@ -35,6 +35,14 @@
|
|||
'click #addDocument': 'addDocument'
|
||||
},
|
||||
|
||||
remove: function () {
|
||||
this.$el.empty().off(); /* off to unbind the events */
|
||||
this.stopListening();
|
||||
this.unbind();
|
||||
delete this.el;
|
||||
return this;
|
||||
},
|
||||
|
||||
checkSearchBox: function (e) {
|
||||
if ($(e.currentTarget).val() === '') {
|
||||
this.editor.expandAll();
|
||||
|
@ -208,7 +216,9 @@
|
|||
iconlib: 'fontawesome4'
|
||||
};
|
||||
this.editor = new JSONEditor(container, options);
|
||||
this.editor.setMode(this.defaultMode);
|
||||
if (this.defaultMode) {
|
||||
this.editor.setMode(this.defaultMode);
|
||||
}
|
||||
|
||||
return this;
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue