Skip to content

Commit

Permalink
Fixed Profession Opt. Fields Being Incorrectly Removed
Browse files Browse the repository at this point in the history
- All but one profession field was being removed from the page when the save options button was hit
- Empty profession fields are now correctly removed from the page, before saving
  • Loading branch information
TheMacLab committed Nov 13, 2014
1 parent d26690e commit 8114c45
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion scripts/go_options.js
Original file line number Diff line number Diff line change
Expand Up @@ -519,7 +519,15 @@ jQuery(document).ready(function(){
});

if (jQuery('input[name="go_focus_switch"]').is(':checked')) {
jQuery('.go_options_profession_input[value=""]').attr('disabled', 'disabled');
jQuery('.go_options_profession_input').filter(function () {
var re = new RegExp("(\\\S)+");
if (this.value.length > 0 && re.test(this.value)) {
return true;
} else {
jQuery(this).remove();
return false;
}
});
var values = jQuery('.go_options_profession_input').map(function() {
return jQuery(this).val();
}).get();
Expand Down

0 comments on commit 8114c45

Please sign in to comment.