Fix clear filter not clearing date label

Closes SCI-3226
This commit is contained in:
Jure Grabnar 2019-03-27 18:47:34 +01:00
parent 07609d34c8
commit aa186f675a
2 changed files with 7 additions and 6 deletions

View file

@ -95,7 +95,7 @@ $(function() {
var dateContainer = $('.ga-side .date-selector.filter-block');
if (updateRunning) return false;
$('.ga-top .ga-tags').children().remove();
if (dateContainer[0].dataset.periodSelect && dateContainer[0].dataset.periodSelect !== 'null') {
if (dateContainer[0].dataset.periodSelect) {
$('<li class="select2-selection__choice">'
+ dateContainer[0].dataset.periodLabel
+ $('.ga-side .date-selector.filter-block')[0].dataset.periodSelect
@ -155,7 +155,7 @@ $(function() {
function resetHotButtonsBackgroundColor() {
$('.date-selector .hot-button').each(function() {
$(this).removeClass('selected');
})
});
}
// Common selection intialize
@ -188,7 +188,8 @@ $(function() {
$('.ga-side .subject-selector select').select2MultipleClearAll();
$('#calendar-from-date').data('DateTimePicker').clear();
$('#calendar-to-date').data('DateTimePicker').clear();
$('.ga-side .date-selector.filter-block')[0].dataset.periodSelect = null;
$('.ga-side .date-selector.filter-block')[0].dataset.periodSelect = '';
updateRunning = false;
GlobalActivitiesUpdateTopPaneTags();
reloadActivities();
@ -201,8 +202,8 @@ $(function() {
dateContainer[0].dataset.periodSelect = $('#calendar-from-date').val() + ' - ' + $('#calendar-to-date').val();
GlobalActivitiesUpdateTopPaneTags();
reloadActivities();
resetHotButtonsBackgroundColor();
}
resetHotButtonsBackgroundColor();
});
$('#calendar-from-date').on('dp.change', function(e) {
@ -212,8 +213,8 @@ $(function() {
dateContainer[0].dataset.periodSelect = $('#calendar-from-date').val() + ' - ' + $('#calendar-to-date').val();
GlobalActivitiesUpdateTopPaneTags();
reloadActivities();
resetHotButtonsBackgroundColor();
}
resetHotButtonsBackgroundColor();
});
GlobalActivitiesUpdateTopPaneTags();

View file

@ -231,4 +231,4 @@ en:
inventories: "Inventories"
protocol_repository: "Protocol repository"
team: "Team"
exports: "Exports"
exports: "Exports"