1
0
Fork 0

query editor usability

This commit is contained in:
hkernbach 2016-10-04 19:35:36 +02:00
parent cc9853c2c4
commit dd229f82cf
1 changed files with 22 additions and 1 deletions

View File

@ -331,7 +331,7 @@
this.toggleQueries();
}
var lastQueryName = $('#lastQueryName').html();
var lastQueryName = localStorage.getItem('lastOpenQuery');
// backup the last query
this.state.lastQuery.query = this.aqlEditor.getValue();
this.state.lastQuery.bindParam = this.bindParamTableObj;
@ -1026,6 +1026,27 @@
'</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) {