diff --git a/facetapi.js b/facetapi.js index 3508ccb..42bce38 100644 --- a/facetapi.js +++ b/facetapi.js @@ -136,7 +136,6 @@ Drupal.facetapi.makeCheckbox = function(element, facet_settings) { checkbox.attr('checked', true); $link.before(label).before(checkbox); - // Hide the link if set to do so. if (!facet_settings.show_active_label) { $link.hide(); } diff --git a/plugins/facetapi/widget_links.inc b/plugins/facetapi/widget_links.inc index cb1811f..791671b 100644 --- a/plugins/facetapi/widget_links.inc +++ b/plugins/facetapi/widget_links.inc @@ -266,9 +266,7 @@ class FacetapiWidgetCheckboxLinks extends FacetapiWidgetLinks { * {@inheritdoc} */ function buildListItems($build) { - // Pass some of this facet's settings to the front-end. - $this->jsSettings['show_active_label'] = $this->settings->settings['show_active_label']; - + $this->addShowActiveLabelJsSetting(); return parent::buildListItems($build); } @@ -300,4 +298,12 @@ class FacetapiWidgetCheckboxLinks extends FacetapiWidgetLinks { 'show_active_label' => 0, ); } + + /** + * Copy the show_active_label setting into the JS settings. + */ + private function addShowActiveLabelJsSetting() { + $this->jsSettings['show_active_label'] = $this->settings->settings['show_active_label']; + } + }