summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Pott2015-06-11 23:43:33 +0100
committerAlex Pott2015-06-11 23:43:33 +0100
commit8d9f1eaf1fa6931dd5469d7a031999aa2fea5a2f (patch)
tree7abb5746aaf9c32d470c065cd018062cc4339d3b
parent15a3f2de2d531c777dc7a01cf9779d2e426e213c (diff)
Issue #2496501 by olli, NickWilde: Grouped Filters Javascript Improvements
-rw-r--r--core/modules/views_ui/js/views-admin.js18
1 files changed, 10 insertions, 8 deletions
diff --git a/core/modules/views_ui/js/views-admin.js b/core/modules/views_ui/js/views-admin.js
index 17b16d5..5f1ce22 100644
--- a/core/modules/views_ui/js/views-admin.js
+++ b/core/modules/views_ui/js/views-admin.js
@@ -1006,22 +1006,24 @@
* @type {Drupal~behavior}
*/
Drupal.behaviors.viewsUiChangeDefaultWidget = {
- attach: function () {
+ attach: function (context) {
+ var $context = $(context);
+
function changeDefaultWidget(event) {
if ($(event.target).prop('checked')) {
- $('input.default-radios').hide();
- $('td.any-default-radios-row').parent().hide();
- $('input.default-checkboxes').show();
+ $context.find('input.default-radios').parent().hide();
+ $context.find('td.any-default-radios-row').parent().hide();
+ $context.find('input.default-checkboxes').parent().show();
}
else {
- $('input.default-checkboxes').hide();
- $('td.any-default-radios-row').parent().show();
- $('input.default-radios').show();
+ $context.find('input.default-checkboxes').parent().hide();
+ $context.find('td.any-default-radios-row').parent().show();
+ $context.find('input.default-radios').parent().show();
}
}
// Update on widget change.
- $('input[name="options[group_info][multiple]"]')
+ $context.find('input[name="options[group_info][multiple]"]')
.on('change', changeDefaultWidget)
// Update the first time the form is rendered.
.trigger('change');