Skip to content

Commit

Permalink
Fix logic for setting up values of select element in ModelBinding.
Browse files Browse the repository at this point in the history
  • Loading branch information
toots committed Jul 9, 2012
1 parent aab792a commit 6655f2b
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions lib/appetizer/ui/vendor/js/backbone.modelbinding.js
Expand Up @@ -329,10 +329,8 @@ var modelbinding = (function(Backbone, _, $) {
var attr_value = getAttributeValue(model, attribute_name);
if (typeof attr_value !== "undefined" && attr_value !== null) {
element.val(attr_value);
}

// set the model to the form's value if there is no model value
if (element.val() != attr_value) {
} else {
// set the model to the form's value if there is no model value
var value = element.val();
var text = element.find(":selected").text();
setModelValue(attribute_name, value, text);
Expand Down

0 comments on commit 6655f2b

Please sign in to comment.