diff --git a/core/misc/ajax.js b/core/misc/ajax.js index 09621b2..1a2f513 100644 --- a/core/misc/ajax.js +++ b/core/misc/ajax.js @@ -200,7 +200,7 @@ // elements that submit to the same URL as the form when there's a file // input. For example, this means the Delete button on the edit form of // an Article node doesn't open its confirmation form in a dialog. - if (this.$form.find(':file').length) { + if (this.$form.find('input[type="file"]').length) { return; } } diff --git a/core/misc/vertical-tabs.js b/core/misc/vertical-tabs.js index 6efa4c3..b3804ce 100644 --- a/core/misc/vertical-tabs.js +++ b/core/misc/vertical-tabs.js @@ -102,7 +102,7 @@ if (event.keyCode === 13) { self.focus(); // Set focus on the first input field of the visible details/tab pane. - $(".vertical-tabs-pane :input:visible:enabled:first").trigger('focus'); + $('.vertical-tabs-pane').find('input, button, textarea, select').filter(':visible:enabled').first().trigger('focus'); } }); diff --git a/core/modules/content_translation/content_translation.admin.js b/core/modules/content_translation/content_translation.admin.js index 13a752f..4845a6c 100644 --- a/core/modules/content_translation/content_translation.admin.js +++ b/core/modules/content_translation/content_translation.admin.js @@ -70,35 +70,35 @@ attach: function (context) { // Initially hide all field rows for non translatable bundles and all column // rows for non translatable fields. - $(context).find('table .bundle-settings .translatable :input').once('translation-entity-admin-hide', function () { + $(context).find('table .bundle-settings .translatable').find('input,button,textarea,select').once('translation-entity-admin-hide', function () { var $input = $(this); var $bundleSettings = $input.closest('.bundle-settings'); if (!$input.is(':checked')) { $bundleSettings.nextUntil('.bundle-settings').hide(); } else { - $bundleSettings.nextUntil('.bundle-settings', '.field-settings').find('.translatable :input:not(:checked)').closest('.field-settings').nextUntil(':not(.column-settings)').hide(); + $bundleSettings.nextUntil('.bundle-settings', '.field-settings').find('.translatable').find('input,button,textarea,select').not(':checked').closest('.field-settings').nextUntil(':not(.column-settings)').hide(); } }); // When a bundle is made translatable all of its field instances should // inherit this setting. Instead when it is made non translatable its field // instances are hidden, since their translatability no longer matters. - $('body').once('translation-entity-admin-bind').on('click', 'table .bundle-settings .translatable :input', function (e) { + $('body').once('translation-entity-admin-bind').on('click', 'table .bundle-settings .translatable input', function (e) { var $target = $(e.target); var $bundleSettings = $target.closest('.bundle-settings'); var $settings = $bundleSettings.nextUntil('.bundle-settings'); var $fieldSettings = $settings.filter('.field-settings'); if ($target.is(':checked')) { - $bundleSettings.find('.operations :input[name$="[language_show]"]').prop('checked', true); - $fieldSettings.find('.translatable :input').prop('checked', true); + $bundleSettings.find('.operations input').filter('input[name$="[language_show]"]').prop('checked', true); + $fieldSettings.find('.translatable input').prop('checked', true); $settings.show(); } else { $settings.hide(); } }) - .on('click', 'table .field-settings .translatable :input', function (e) { + .on('click', 'input', function (e) { var $target = $(e.target); var $fieldSettings = $target.closest('.field-settings'); var $columnSettings = $fieldSettings.nextUntil('.field-settings, .bundle-settings'); diff --git a/core/modules/edit/js/editors/formEditor.js b/core/modules/edit/js/editors/formEditor.js index 251031d..74227a9 100644 --- a/core/modules/edit/js/editors/formEditor.js +++ b/core/modules/edit/js/editors/formEditor.js @@ -110,7 +110,7 @@ }); $formContainer - .on('formUpdated.edit', ':input', function (event) { + .on('formUpdated.edit', 'input,button,textarea,select', function (event) { var state = fieldModel.get('state'); // If the form is in an invalid state, it will persist on the page. // Set the field to activating so that the user can correct the @@ -147,7 +147,7 @@ // Allow form widgets to detach properly. Drupal.detachBehaviors(this.$formContainer.get(0), null, 'unload'); this.$formContainer - .off('change.edit', ':input') + .off('change.edit', 'input,button,textarea,select') .off('keypress.edit', 'input') .remove(); this.$formContainer = null; diff --git a/core/modules/edit/js/views/EditorView.js b/core/modules/edit/js/views/EditorView.js index 5108fcf..3456a67 100644 --- a/core/modules/edit/js/views/EditorView.js +++ b/core/modules/edit/js/views/EditorView.js @@ -184,7 +184,7 @@ var $form = $('#' + backstageId).find('form'); // Fill in the value in any that isn't hidden or a submit // button. - $form.find(':input[type!="hidden"][type!="submit"]:not(select)') + $form.find('input[type!="hidden"][type!="submit"],textarea') // Don't mess with the node summary. .not('[name$="\\[summary\\]"]').val(value); // Submit the form. diff --git a/core/modules/views_ui/js/views-admin.js b/core/modules/views_ui/js/views-admin.js index d0204e6..0958df2 100644 --- a/core/modules/views_ui/js/views-admin.js +++ b/core/modules/views_ui/js/views-admin.js @@ -178,7 +178,7 @@ Drupal.viewsUi.AddItemForm = function ($form) { this.$form = $form; - this.$form.find('.views-filterable-options :checkbox').on('click', $.proxy(this.handleCheck, this)); + this.$form.find('.views-filterable-options input[type="checkbox"]').on('click', $.proxy(this.handleCheck, this)); // Find the wrapper of the displayed text. this.$selected_div = this.$form.find('.views-selected-options').parent(); this.$selected_div.hide(); @@ -847,7 +847,7 @@ Drupal.viewsUi.Checkboxifier = function (button) { this.$button = $(button); this.$parent = this.$button.parent('div.views-expose, div.views-grouped'); - this.$input = this.$parent.find('input:checkbox, input:radio'); + this.$input = this.$parent.find('input[type=checkbox], input[type=radio]'); // Hide the button and its description. this.$button.hide(); this.$parent.find('.exposed-description, .grouped-description').hide();