Skip to content

Commit

Permalink
Make back-end URL endpoint configurable
Browse files Browse the repository at this point in the history
  • Loading branch information
bergie committed Nov 2, 2011
1 parent e648389 commit fcddf6a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
5 changes: 3 additions & 2 deletions src/jquery.Midgard.midgardCreate.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
saveButton: null,
state: 'browse',
highlightColor: '#67cc08',
editor: 'hallo'
editor: 'hallo',
url: ''
},

_create: function() {
Expand All @@ -15,7 +16,7 @@
this._enableToolbar();
this._saveButton();
this._editButton();
this.element.midgardStorage({vie: this.vie});
this.element.midgardStorage({vie: this.vie, url: this.options.url});
},

_init: function() {
Expand Down
7 changes: 4 additions & 3 deletions src/jquery.Midgard.midgardStorage.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
localStorage: false,
vie: null,
changedModels: [],
loaded: function() {}
loaded: function() {},
url: ''
},

_create: function() {
Expand All @@ -17,8 +18,8 @@
this.vie = this.options.vie;

this.vie.entities.bind('add', function(model) {
// Add the Midgard-specific save URL used by Backbone.sync
model.url = '/mgd:create/object/';
// Add the back-end URL used by Backbone.sync
model.url = widget.options.url;
model.toJSON = model.toJSONLD;
});

Expand Down

0 comments on commit fcddf6a

Please sign in to comment.