1
0
Fork 0

disable caching of collection type when creating documents

This commit is contained in:
Jan Steemann 2013-11-12 15:06:22 +01:00
parent 1afe978304
commit ba25030fd7
2 changed files with 5 additions and 3 deletions

View File

@ -122,8 +122,9 @@ window.arangoHelper = {
return val.substr(0, 1) === '_';
},
collectionApiType: function (identifier) {
if (this.CollectionTypes[identifier] === undefined) {
collectionApiType: function (identifier, refresh) {
// set "refresh" to disable caching collection type
if (refresh || this.CollectionTypes[identifier] === undefined) {
this.CollectionTypes[identifier] = window.arangoDocumentStore
.getCollectionInfo(identifier).type;
}

View File

@ -331,7 +331,8 @@ var documentsView = Backbone.View.extend({
addDocument: function () {
var collid = window.location.hash.split("/")[1];
var doctype = arangoHelper.collectionApiType(collid);
// second parameter is "true" to disable caching of collection type
var doctype = arangoHelper.collectionApiType(collid, true);
if (doctype === 'edge') {
$('#edgeCreateModal').modal('show');