Last active
December 14, 2015 01:18
-
-
Save vkareh/5005486 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Implements hook_form_FORM_ID_alter() for views_exposed_form. | |
*/ | |
function MODULE_form_views_exposed_form_alter(&$form, &$form_state) { | |
$form['#after_build'] = array('_MODULE_apply_js'); | |
} | |
function _MODULE_apply_js($form, &$form_state) { | |
drupal_add_js(drupal_get_path('theme', 'wsup') . '/scripts/script.js'); | |
return $form; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function ($) { | |
Drupal.behaviors.wsupStyleFilters = { | |
attach: function (context, settings) { | |
console.log('JS Loaded!'); | |
$('input[type=checkbox]:checked').next('label').addClass('selected'); | |
$(".views-exposed-form select").styleSelect(); | |
$(".views-exposed-form select").change(function() { | |
console.log('Filter Changed!'); | |
// $(this).parents("form").submit(); | |
} | |
}; | |
})(jQuery); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment