Skip to content

Commit

Permalink
Upgrading to Backbone 0.9.10
Browse files Browse the repository at this point in the history
  • Loading branch information
philfreo committed Feb 7, 2013
1 parent 0116fea commit e0f7be2
Show file tree
Hide file tree
Showing 5 changed files with 1,507 additions and 10 deletions.
9 changes: 4 additions & 5 deletions src/editors.js
Expand Up @@ -92,15 +92,14 @@ Form.editors = (function() {
*
* @return {Mixed} error
*/
commit: function() {
commit: function(options) {
var error = this.validate();
if (error) return error;

this.model.set(this.key, this.getValue(), {
error: function(model, e) {
error = e;
}
this.listenTo(this.model, 'invalid', function(model, e) {
error = e;
});
this.model.set(this.key, this.getValue(), options);

if (error) return error;
},
Expand Down
2 changes: 1 addition & 1 deletion test/distribution.html
Expand Up @@ -18,7 +18,7 @@
<script src="lib/jquery-ui/jquery-ui-1.8.14.custom.min.js"></script>

<script src="lib/underscore-1.4.4.js"></script>
<script src="lib/backbone-0.9.2.min.js"></script>
<script src="lib/backbone-0.9.10.js"></script>
<script src="lib/backbone-deep-model.js"></script>
<script src="lib/handlebars-1.0.rc.2.js"></script>

Expand Down
6 changes: 3 additions & 3 deletions test/editors.js
Expand Up @@ -88,7 +88,7 @@ module('Base');
key: 'title'
}).render();

var err = editor.commit();
var err = editor.commit({ validate: true });

equal(err, 'ERROR');
});
Expand Down Expand Up @@ -1010,10 +1010,10 @@ module('Select', {
test('Options as a new collection (needs to be fetched)', function() {
OptionCollection.prototype.sync = function(method, collection, options) {
if (method === 'read') {
options.success([
options.success(collection, [
{ id: 'kid1', name: 'Barbara' },
{ id: 'kid2', name: 'Phil' }
]);
], options);
}
};

Expand Down
2 changes: 1 addition & 1 deletion test/index.html
Expand Up @@ -18,7 +18,7 @@
<script src="lib/jquery-ui/jquery-ui-1.8.14.custom.min.js"></script>

<script src="lib/underscore-1.4.4.js"></script>
<script src="lib/backbone-0.9.2.min.js"></script>
<script src="lib/backbone-0.9.10.js"></script>
<script src="lib/backbone-deep-model.js"></script>
<script src="lib/handlebars-1.0.rc.2.js"></script>

Expand Down

0 comments on commit e0f7be2

Please sign in to comment.