Skip to content
Snippets Groups Projects
Commit 3866a774 authored by Andrew Zahura's avatar Andrew Zahura Committed by Markus Kalkbrenner
Browse files

Issue #3210353 by shkiper, mkalkbrenner, Yujiman85: Issue with browser Back...

Issue #3210353 by shkiper, mkalkbrenner, Yujiman85: Issue with browser Back button and Checkbox widget
parent d5f56fec
No related branches found
No related tags found
5 merge requests!258Issue #3264284 by BAHbKA, mkalkbrenner: Facets summary should be cacheable, in...,!234Issue #3264284 by BAHbKA, mkalkbrenner: Facets summary should be cacheable, in...,!200Issue #3264284 by BAHbKA, mkalkbrenner: Facets summary should be cacheable, in...,!120Issue #3300227: Use "more entropy" parameters on uniqid method,!84#3300227: use more entropy parameter for uniqid()
......@@ -14,6 +14,19 @@
}
};
window.onbeforeunload = function(e) {
if (Drupal.facets) {
var $checkboxWidgets = $('.js-facets-checkbox-links');
if ($checkboxWidgets.length > 0) {
$checkboxWidgets.each(function (index, widget) {
var $widget = $(widget);
var $widgetLinks = $widget.find('.facet-item > a');
$widgetLinks.each(Drupal.facets.updateCheckbox);
});
}
}
};
/**
* Turns all facet links into checkboxes.
*/
......@@ -79,6 +92,18 @@
};
/**
* Update checkbox active state.
*/
Drupal.facets.updateCheckbox = function () {
var $link = $(this);
var active = $link.hasClass('is-active');
if (!active) {
$link.parent().find('input.facets-checkbox').prop('checked', false);
}
};
/**
* Disable all facet checkboxes in the facet and apply a 'disabled' class.
*
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment