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, async: false,
success: function(data) { success: function(data) {
returnobj.status = true; returnobj.status = true;
returnobj.data = data;
}, },
error: function(data) { error: function(data) {
returnobj.status = false; returnobj.status = false;

View File

@ -131,7 +131,7 @@ var collectionView = Backbone.View.extend({
}, },
deleteCollection: function () { deleteCollection: function () {
var self = this; var self = this;
var collName = $('#change-collection-name').val(); var collName = self.myCollection.name;
var returnval = window.arangoCollectionsStore.deleteCollection(collName); var returnval = window.arangoCollectionsStore.deleteCollection(collName);
if (returnval === true) { if (returnval === true) {
self.hideModal(); self.hideModal();

View File

@ -20,11 +20,11 @@ window.CollectionListItemView = Backbone.View.extend({
editProperties: function (event) { editProperties: function (event) {
event.stopPropagation(); 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() { 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) { noop: function(event) {

View File

@ -40,13 +40,13 @@ var documentsView = Backbone.View.extend({
}, },
buildCollectionLink : function (collection) { buildCollectionLink : function (collection) {
return "#collection/" + encodeURIComponent(collection.get('name')) + '/documents/1'; return "collection/" + encodeURIComponent(collection.get('name')) + '/documents/1';
}, },
prevCollection : function () { prevCollection : function () {
if (this.collectionContext.prev !== null) { if (this.collectionContext.prev !== null) {
$('#collectionPrev').parent().removeClass('disabledPag'); $('#collectionPrev').parent().removeClass('disabledPag');
window.location.hash = this.buildCollectionLink(this.collectionContext.prev); window.App.navigate(this.buildCollectionLink(this.collectionContext.prev));
} }
else { else {
$('#collectionPrev').parent().addClass('disabledPag'); $('#collectionPrev').parent().addClass('disabledPag');
@ -56,7 +56,7 @@ var documentsView = Backbone.View.extend({
nextCollection : function () { nextCollection : function () {
if (this.collectionContext.next !== null) { if (this.collectionContext.next !== null) {
$('#collectionNext').parent().removeClass('disabledPag'); $('#collectionNext').parent().removeClass('disabledPag');
window.location.hash = this.buildCollectionLink(this.collectionContext.next); window.App.navigate(this.buildCollectionLink(this.collectionContext.next));
} }
else { else {
$('#collectionNext').parent().addClass('disabledPag'); $('#collectionNext').parent().addClass('disabledPag');
@ -76,7 +76,7 @@ var documentsView = Backbone.View.extend({
var result = window.arangoDocumentStore.createTypeDocument(collid); var result = window.arangoDocumentStore.createTypeDocument(collid);
//Success //Success
if (result !== false) { if (result !== false) {
window.location.hash = "collection/"+result; window.location.hash = "collection/" + result;
arangoHelper.arangoNotification('Document created'); arangoHelper.arangoNotification('Document created');
} }
//Error //Error

View File

@ -38,7 +38,6 @@ var newCollectionView = Backbone.View.extend({
}, },
hidden: function () { hidden: function () {
window.App.navigate("#");
}, },
saveNewCollection: function() { saveNewCollection: function() {
@ -74,17 +73,15 @@ var newCollectionView = Backbone.View.extend({
self.hidden(); self.hidden();
$("#add-collection").modal('hide'); $("#add-collection").modal('hide');
arangoHelper.arangoNotification("Collection created"); arangoHelper.arangoNotification("Collection created");
window.App.navigate("collection/" + collName + "/documents/1", {trigger: true});
} }
else { else {
self.hidden(); self.hidden();
$("#add-collection").modal('hide'); $("#add-collection").modal('hide');
arangoHelper.arangoError(returnobj.errorMessage); arangoHelper.arangoError(returnobj.errorMessage);
window.App.navigate("#");
} }
window.arangoCollectionsStore.fetch({
success: function () {
window.collectionsView.render();
}
});
} }
}); });