Permalink
Browse files

Don't trigger model set for select with no value.

  • Loading branch information...
1 parent 261d83b commit f83c8382b5921b2ec879a91cafcb17bca00041b9 @lukegalea committed Mar 30, 2012
Showing with 1 addition and 0 deletions.
  1. +1 −0 backbone.modelbinding.js
View
1 backbone.modelbinding.js
@@ -230,6 +230,7 @@ var modelbinding = (function(Backbone, _, $) {
var modelChange = function(changed_model, val){ element.val(val); };
var setModelValue = function(attr, val, text){
+ if (val === '') return;
var data = {};
data[attr] = val;
data[attr + "_text"] = text;

0 comments on commit f83c838

Please sign in to comment.