From ba25030fd77fb49e2a6f90d14ff565490de0b15c Mon Sep 17 00:00:00 2001 From: Jan Steemann Date: Tue, 12 Nov 2013 15:06:22 +0100 Subject: [PATCH] disable caching of collection type when creating documents --- js/apps/system/aardvark/frontend/js/arango/arango.js | 5 +++-- js/apps/system/aardvark/frontend/js/views/documentsView.js | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/js/apps/system/aardvark/frontend/js/arango/arango.js b/js/apps/system/aardvark/frontend/js/arango/arango.js index 6a1daecea2..66ac399918 100644 --- a/js/apps/system/aardvark/frontend/js/arango/arango.js +++ b/js/apps/system/aardvark/frontend/js/arango/arango.js @@ -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; } diff --git a/js/apps/system/aardvark/frontend/js/views/documentsView.js b/js/apps/system/aardvark/frontend/js/views/documentsView.js index 91a302f8ae..abbc788391 100644 --- a/js/apps/system/aardvark/frontend/js/views/documentsView.js +++ b/js/apps/system/aardvark/frontend/js/views/documentsView.js @@ -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');