mirror of https://gitee.com/bigwinds/arangodb
query editor usability
This commit is contained in:
parent
cc9853c2c4
commit
dd229f82cf
|
@ -331,7 +331,7 @@
|
||||||
this.toggleQueries();
|
this.toggleQueries();
|
||||||
}
|
}
|
||||||
|
|
||||||
var lastQueryName = $('#lastQueryName').html();
|
var lastQueryName = localStorage.getItem('lastOpenQuery');
|
||||||
// backup the last query
|
// backup the last query
|
||||||
this.state.lastQuery.query = this.aqlEditor.getValue();
|
this.state.lastQuery.query = this.aqlEditor.getValue();
|
||||||
this.state.lastQuery.bindParam = this.bindParamTableObj;
|
this.state.lastQuery.bindParam = this.bindParamTableObj;
|
||||||
|
@ -1026,6 +1026,27 @@
|
||||||
'</tr>'
|
'</tr>'
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// check if existing entry already has a stored value
|
||||||
|
var queryName = localStorage.getItem('lastOpenQuery');
|
||||||
|
var query = this.collection.findWhere({name: queryName});
|
||||||
|
|
||||||
|
try {
|
||||||
|
query = query.toJSON();
|
||||||
|
} catch (ignore) {
|
||||||
|
}
|
||||||
|
|
||||||
|
if (query) {
|
||||||
|
var attributeName;
|
||||||
|
_.each($('#arangoBindParamTable input'), function (elem) {
|
||||||
|
attributeName = $(elem).attr('name');
|
||||||
|
_.each(query.parameter, function (qVal, qKey) {
|
||||||
|
if (qKey === attributeName) {
|
||||||
|
$(elem).val(qVal);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
fillBindParamTable: function (object) {
|
fillBindParamTable: function (object) {
|
||||||
|
|
Loading…
Reference in New Issue