Skip to content

Commit

Permalink
Simplify model URL registration
Browse files Browse the repository at this point in the history
  • Loading branch information
bergie committed Jul 6, 2011
1 parent e8b7aa9 commit 9589da6
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions static/js/midgardStorage.js
Expand Up @@ -17,7 +17,9 @@

// TODO: This won't be necessary when we have our own Backbone.sync
VIE.EntityManager.entities.bind('add', function(model) {
widget._prepareEntity(model);
// Add the Midgard-specific save URL used by Backbone.sync
model.url = '/mgd:create/object/';
model.toJSON = model.toJSONLD;
});

jQuery('#midgardcreate-save').click(function() {
Expand Down Expand Up @@ -67,14 +69,6 @@
});
},

_prepareEntity: function(model) {
var widget = this;

// Add the Midgard-specific save URL used by Backbone.sync
model.url = '/mgd:create/object/';
model.toJSON = model.toJSONLD;
},

_saveRemote: function(options) {
var widget = this;
var needed = widget.options.changedModels.length;
Expand Down

0 comments on commit 9589da6

Please sign in to comment.