Skip to content

Commit

Permalink
Fix select fields regression on master backlog/taskboard after merging
Browse files Browse the repository at this point in the history
…#942.

Added check to ensure default select value does not override values of existing stories/tasks.
  • Loading branch information
bohansen committed Jul 22, 2013
1 parent 12682f5 commit 5cda37b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion assets/javascripts/model.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,12 @@ RB.Model = RB.Object.create({

// Copy the value in the field to the input element
value = ( fieldType=='select' ? field.children('.v').first().text() : RB.$.trim(field.text()) );
if ((fieldType=='select') && input.children("option[selected='selected']")) {

// Select default value for select fields if none is already selected
if ((fieldType=='select') && input.children("option[selected='selected']") && value == '') {
value = input.children("option[selected='selected']:first").val();
}

input.val(value);

// Record in the model's root element which input field had the last focus. We will
Expand Down

0 comments on commit 5cda37b

Please sign in to comment.