1
0
Fork 0

Merge branch 'devel' of github.com:triAGENS/ArangoDB into devel

This commit is contained in:
Michael Hackstein 2013-03-26 15:33:17 +01:00
commit 2f7bd44d45
5 changed files with 11 additions and 13 deletions

View File

@ -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;

View File

@ -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();

View File

@ -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) {

View File

@ -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

View File

@ -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();
}
});
}
});