diff --git a/core/misc/ajax.js b/core/misc/ajax.js
index f9b8b5a..881b453 100644
--- a/core/misc/ajax.js
+++ b/core/misc/ajax.js
@@ -200,7 +200,7 @@ Drupal.ajax = function (base, element, element_settings) {
// 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('[type=file]').length) {
+ if (this.form.find('input[type="file"]').length) {
return;
}
}
diff --git a/core/misc/form.js b/core/misc/form.js
index 9179eff..2290730 100644
--- a/core/misc/form.js
+++ b/core/misc/form.js
@@ -50,7 +50,7 @@ Drupal.behaviors.formUpdated = {
$(context)
// Since context could be an input element itself, it's added back to
// the jQuery object and filtered again.
- .find('input,button,textarea,select').addBack().find('input,button,textarea,select')
+ .find('input,button,textarea,select').addBack().filter('input,button,textarea,select')
// To prevent duplicate events, the handlers are first removed and then
// (re-)added.
.off(events).on(events, function () {
diff --git a/core/misc/tableresponsive.js b/core/misc/tableresponsive.js
index 645ebc1..4a62a26 100644
--- a/core/misc/tableresponsive.js
+++ b/core/misc/tableresponsive.js
@@ -33,7 +33,7 @@ function TableResponsive (table) {
this.hideText = Drupal.t('Hide unimportant columns');
// Store a reference to the header elements of the table so that the DOM is
// traversed only once to find them.
- this.$headers = this.$table.find('th').parent();
+ this.$headers = this.$table.find('th');
// Add a link before the table for users to show or hide weight columns.
this.$link = $('')
.attr('title', Drupal.t('Show table cells that were hidden to make the table fit within a small screen.'))
diff --git a/core/modules/content_translation/content_translation.admin.js b/core/modules/content_translation/content_translation.admin.js
index c464152..f3417ab 100644
--- a/core/modules/content_translation/content_translation.admin.js
+++ b/core/modules/content_translation/content_translation.admin.js
@@ -84,15 +84,13 @@ Drupal.behaviors.contentTranslation = {
// 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.
- var $bundleInput = $('table .bundle-settings .translatable').find('input,button,textarea,select');
- var $fieldInput = $('table .field-settings .translatable').find('input,button,textarea,select');
- $('body').once('translation-entity-admin-bind').on('click', $tableInput, function (e) {
+ $('body').once('translation-entity-admin-bind').on('click', 'input,button,textarea,select', 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').find('input,button,textarea,select').filter('[name$="[language_show]"]').prop('checked', true);
+ $bundleSettings.find('.operations').find('input,button,textarea,select').filter('input[name$="[language_show]"]').prop('checked', true);
$fieldSettings.find('.translatable').find('input,button,textarea,select').prop('checked', true);
$settings.show();
}
@@ -100,7 +98,7 @@ Drupal.behaviors.contentTranslation = {
$settings.hide();
}
})
- .on('click', $fieldInput, function (e) {
+ .on('click', 'input,button,textarea,select', 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 66510e5..100b274 100644
--- a/core/modules/edit/js/editors/formEditor.js
+++ b/core/modules/edit/js/editors/formEditor.js
@@ -107,9 +107,9 @@ Drupal.edit.editors.form = Drupal.edit.EditorView.extend({
data: form,
selector: '#' + id + ' .placeholder'
});
- var $input = $formContainer.find('input,button,textarea,select');
+
$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
@@ -146,7 +146,7 @@ Drupal.edit.editors.form = Drupal.edit.EditorView.extend({
// Allow form widgets to detach properly.
Drupal.detachBehaviors(this.$formContainer, 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/models/EntityModel.js b/core/modules/edit/js/models/EntityModel.js
index 99bd7a6..913abb3 100644
--- a/core/modules/edit/js/models/EntityModel.js
+++ b/core/modules/edit/js/models/EntityModel.js
@@ -304,7 +304,7 @@ Drupal.edit.EntityModel = Backbone.Model.extend({
// "Save" button again.
entityModel.set('state', 'opened', { reason: 'networkerror' });
// Show a modal to inform the user of the network error.
- var message = Drupal.t('Your changes to @entity-title could not be saved, either due to a website problem or a network connection problem. Please try again.', { '@entity-title' : entityModel.get('label') })
+ var message = Drupal.t('Your changes to @entity-title could not be saved, either due to a website problem or a network connection problem. Please try again.', { '@entity-title' : entityModel.get('label') });
Drupal.edit.util.networkErrorModal(Drupal.t('Sorry!'), message);
}
});
diff --git a/core/modules/edit/js/views/EditorView.js b/core/modules/edit/js/views/EditorView.js
index 0b3452b..baf2943 100644
--- a/core/modules/edit/js/views/EditorView.js
+++ b/core/modules/edit/js/views/EditorView.js
@@ -185,7 +185,7 @@ Drupal.edit.EditorView = Backbone.View.extend({
var $form = $('#' + backstageId).find('form');
// Fill in the value in any that isn't hidden or a submit
// button.
- $form.find('input,button,textarea,select').filter('[type!="hidden"][type!="submit"]:not(select)')
+ $form.find('input,button,textarea,select').filter('input[type!="hidden"][type!="submit"]:not(select)')
// 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 cefed51..cd07e6e 100644
--- a/core/modules/views_ui/js/views-admin.js
+++ b/core/modules/views_ui/js/views-admin.js
@@ -177,7 +177,7 @@ Drupal.behaviors.addItemForm = {
Drupal.viewsUi.AddItemForm = function ($form) {
this.$form = $form;
- this.$form.find('.views-filterable-options [type=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();