Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
johnvanbreda committed Nov 30, 2017
2 parents 789611c + 88d9ad5 commit 9337bee
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions js/reportFilters.js
Original file line number Diff line number Diff line change
Expand Up @@ -638,8 +638,10 @@ jQuery(document).ready(function ($) {
$('#identification_difficulty_op').find("option[value='" + op + "']").html() +
' ' + indiciaData.filter.def.identification_difficulty);
}
if (indiciaData.filter.def.has_photos) {
if (indiciaData.filter.def.has_photos && indiciaData.filter.def.has_photos === '1') {
r.push(indiciaData.lang.HasPhotos);
} else if (indiciaData.filter.def.has_photos && indiciaData.filter.def.has_photos === '0') {
r.push(indiciaData.lang.HasNoPhotos);
}
return r.join('<br/>');
},
Expand Down Expand Up @@ -1242,6 +1244,7 @@ jQuery(document).ready(function ($) {
// regexp extracts the pane ID from the href. Loop through the controls in the pane
$.each(pane.find(':input').not('#imp-sref-system,:checkbox,[type=button],[name="location_list[]"]'),
function (idx, ctrl) {
var value;
// set control value to the stored filter setting
attrName = $(ctrl).attr('name');
// Special case for dates where the filter value name is prefixed with the date type.
Expand All @@ -1250,7 +1253,8 @@ jQuery(document).ready(function ($) {
attrName = indiciaData.filter.def.date_type + '_' + attrName;
}
if ($(ctrl).is('select')) {
option = $(ctrl).find('option[value="' + indiciaData.filter.def[attrName] + '"]');
value = typeof indiciaData.filter.def[attrName] === 'undefined' ? '' : indiciaData.filter.def[attrName];
option = $(ctrl).find('option[value="' + value + '"]');
if (option) {
option.attr('selected', 'selected');
}
Expand Down

0 comments on commit 9337bee

Please sign in to comment.