diff --git a/html/admin/js/collections/arangoCollections.js b/html/admin/js/collections/arangoCollections.js
index c879527af2..1c7adffd64 100644
--- a/html/admin/js/collections/arangoCollections.js
+++ b/html/admin/js/collections/arangoCollections.js
@@ -149,6 +149,7 @@ window.arangoCollections = Backbone.Collection.extend({
async: false,
success: function(data) {
returnobj.status = true;
+ returnobj.data = data;
},
error: function(data) {
returnobj.status = false;
diff --git a/html/admin/js/views/collectionView.js b/html/admin/js/views/collectionView.js
index d98502b23a..7b57739d87 100644
--- a/html/admin/js/views/collectionView.js
+++ b/html/admin/js/views/collectionView.js
@@ -131,7 +131,7 @@ var collectionView = Backbone.View.extend({
},
deleteCollection: function () {
var self = this;
- var collName = $('#change-collection-name').val();
+ var collName = self.myCollection.name;
var returnval = window.arangoCollectionsStore.deleteCollection(collName);
if (returnval === true) {
self.hideModal();
diff --git a/html/admin/js/views/collectionsItemView.js b/html/admin/js/views/collectionsItemView.js
index 0283064b7a..c9809cc303 100644
--- a/html/admin/js/views/collectionsItemView.js
+++ b/html/admin/js/views/collectionsItemView.js
@@ -20,11 +20,11 @@ window.CollectionListItemView = Backbone.View.extend({
editProperties: function (event) {
event.stopPropagation();
- window.App.navigate("#collection/" + this.model.get("id"), {trigger: true});
+ window.App.navigate("collection/" + encodeURIComponent(this.model.get("id")), {trigger: true});
},
selectCollection: function() {
- window.App.navigate("collection/" + this.model.get("name") + "/documents/1", {trigger: true});
+ window.App.navigate("collection/" + encodeURIComponent(this.model.get("name")) + "/documents/1", {trigger: true});
},
noop: function(event) {
diff --git a/html/admin/js/views/documentsView.js b/html/admin/js/views/documentsView.js
index d54a463739..98711593b8 100644
--- a/html/admin/js/views/documentsView.js
+++ b/html/admin/js/views/documentsView.js
@@ -40,13 +40,13 @@ var documentsView = Backbone.View.extend({
},
buildCollectionLink : function (collection) {
- return "#collection/" + encodeURIComponent(collection.get('name')) + '/documents/1';
+ return "collection/" + encodeURIComponent(collection.get('name')) + '/documents/1';
},
prevCollection : function () {
if (this.collectionContext.prev !== null) {
$('#collectionPrev').parent().removeClass('disabledPag');
- window.location.hash = this.buildCollectionLink(this.collectionContext.prev);
+ window.App.navigate(this.buildCollectionLink(this.collectionContext.prev));
}
else {
$('#collectionPrev').parent().addClass('disabledPag');
@@ -56,7 +56,7 @@ var documentsView = Backbone.View.extend({
nextCollection : function () {
if (this.collectionContext.next !== null) {
$('#collectionNext').parent().removeClass('disabledPag');
- window.location.hash = this.buildCollectionLink(this.collectionContext.next);
+ window.App.navigate(this.buildCollectionLink(this.collectionContext.next));
}
else {
$('#collectionNext').parent().addClass('disabledPag');
@@ -76,7 +76,7 @@ var documentsView = Backbone.View.extend({
var result = window.arangoDocumentStore.createTypeDocument(collid);
//Success
if (result !== false) {
- window.location.hash = "collection/"+result;
+ window.location.hash = "collection/" + result;
arangoHelper.arangoNotification('Document created');
}
//Error
diff --git a/html/admin/js/views/newCollectionView.js b/html/admin/js/views/newCollectionView.js
index 5154862286..0c49e4d086 100644
--- a/html/admin/js/views/newCollectionView.js
+++ b/html/admin/js/views/newCollectionView.js
@@ -38,7 +38,6 @@ var newCollectionView = Backbone.View.extend({
},
hidden: function () {
- window.App.navigate("#");
},
saveNewCollection: function() {
@@ -74,17 +73,15 @@ var newCollectionView = Backbone.View.extend({
self.hidden();
$("#add-collection").modal('hide');
arangoHelper.arangoNotification("Collection created");
+
+ window.App.navigate("collection/" + collName + "/documents/1", {trigger: true});
}
else {
self.hidden();
$("#add-collection").modal('hide');
arangoHelper.arangoError(returnobj.errorMessage);
+ window.App.navigate("#");
}
- window.arangoCollectionsStore.fetch({
- success: function () {
- window.collectionsView.render();
- }
- });
}
});