diff -u b/core/misc/ajax.js b/core/misc/ajax.js --- b/core/misc/ajax.js +++ b/core/misc/ajax.js @@ -378,8 +378,10 @@ /** * Request parameter to indicate that a request is a Drupal Ajax request. + * + * @const */ - Drupal.ajax.AJAX_REQUEST_PARAMETER = '_drupal_ajax'; + Drupal.Ajax.AJAX_REQUEST_PARAMETER = '_drupal_ajax'; /** * Execute the ajax request. @@ -497,7 +499,7 @@ } // Inform Drupal that this is an AJAX request. - options.data[Drupal.ajax.AJAX_REQUEST_PARAMETER] = 1; + options.data[Drupal.Ajax.AJAX_REQUEST_PARAMETER] = 1; // Allow Drupal to return new JavaScript and CSS files to load without // returning the ones already loaded. diff -u b/core/modules/block/js/block.js b/core/modules/block/js/block.js --- b/core/modules/block/js/block.js +++ b/core/modules/block/js/block.js @@ -34,9 +34,9 @@ return vals.join(', '); } - $('[data-drupal-selector="visibility-node-type"], [data-drupal-selector="visibility-language"], [data-drupal-selector="visibility-user-role"]').drupalSetSummary(checkboxesSummary); + $('[data-drupal-selector="edit-visibility-node-type"], [data-drupal-selector="edit-visibility-language"], [data-drupal-selector="edit-visibility-user-role"]').drupalSetSummary(checkboxesSummary); - $('[data-drupal-selector="visibility-request-path"]').drupalSetSummary(function (context) { + $('[data-drupal-selector="edit-visibility-request-path"]').drupalSetSummary(function (context) { var $pages = $(context).find('textarea[name="visibility[request_path][pages]"]'); if (!$pages.val()) { return Drupal.t('Not restricted'); @@ -63,7 +63,7 @@ return; } - var table = $('[data-drupal-selector="blocks"]'); + var table = $('#blocks'); // Get the blocks tableDrag object. var tableDrag = Drupal.tableDrag.blocks; // Add a handler for when a row is swapped, update empty regions. reverted: --- b/core/modules/block/src/BlockForm.php +++ a/core/modules/block/src/BlockForm.php @@ -233,7 +233,6 @@ if (isset($form['node_type'])) { $form['node_type']['#title'] = $this->t('Content types'); - $form['node_type']['#attributes']['data-drupal-selector'] = 'visibility-node-type'; $form['node_type']['bundles']['#title'] = $this->t('Content types'); $form['node_type']['negate']['#type'] = 'value'; $form['node_type']['negate']['#title_display'] = 'invisible'; @@ -241,14 +240,12 @@ } if (isset($form['user_role'])) { $form['user_role']['#title'] = $this->t('Roles'); - $form['user_role']['#attributes']['data-drupal-selector'] = 'visibility-user-role'; unset($form['user_role']['roles']['#description']); $form['user_role']['negate']['#type'] = 'value'; $form['user_role']['negate']['#value'] = $form['user_role']['negate']['#default_value']; } if (isset($form['request_path'])) { $form['request_path']['#title'] = $this->t('Pages'); - $form['request_path']['#attributes']['data-drupal-selector'] = 'visibility-request-path'; $form['request_path']['negate']['#type'] = 'radios'; $form['request_path']['negate']['#default_value'] = (int) $form['request_path']['negate']['#default_value']; $form['request_path']['negate']['#title_display'] = 'invisible'; @@ -258,7 +255,6 @@ ]; } if (isset($form['language'])) { - $form['language']['#attributes']['data-drupal-selector'] = 'visibility-language'; $form['language']['negate']['#type'] = 'value'; $form['language']['negate']['#value'] = $form['language']['negate']['#default_value']; } reverted: --- b/core/modules/block/src/BlockListBuilder.php +++ a/core/modules/block/src/BlockListBuilder.php @@ -177,7 +177,6 @@ ), '#attributes' => array( 'id' => 'blocks', - 'data-drupal-selector' => 'blocks', ), ); reverted: --- b/core/modules/ckeditor/js/ckeditor.admin.js +++ a/core/modules/ckeditor/js/ckeditor.admin.js @@ -343,7 +343,7 @@ Drupal.behaviors.ckeditorAdminButtonPluginSettings = { attach: function (context) { var $context = $(context); + var $ckeditorPluginSettings = $context.find('#ckeditor-plugin-settings').once('ckeditor-plugin-settings'); - var $ckeditorPluginSettings = $context.find('[data-drupal-selector="ckeditor-plugin-settings"]').once('ckeditor-plugin-settings'); if ($ckeditorPluginSettings.length) { // Hide all button-dependent plugin settings initially. $ckeditorPluginSettings.find('[data-ckeditor-buttons]').each(function () { diff -u b/core/modules/ckeditor/js/ckeditor.drupalimage.admin.js b/core/modules/ckeditor/js/ckeditor.drupalimage.admin.js --- b/core/modules/ckeditor/js/ckeditor.drupalimage.admin.js +++ b/core/modules/ckeditor/js/ckeditor.drupalimage.admin.js @@ -7,14 +7,14 @@ */ Drupal.behaviors.ckeditorDrupalImageSettingsSummary = { attach: function () { - $('[data-ckeditor-plugin-id="drupalimage"]').drupalSetSummary(function (context) { + $('#edit-editor-settings-plugins-drupalimage').drupalSetSummary(function (context) { var root = 'input[name="editor[settings][plugins][drupalimage][image_upload]'; var $status = $(root + '[status]"]'); var $maxFileSize = $(root + '[max_size]"]'); */ Drupal.behaviors.ckeditorDrupalImageSettingsSummary = { attach: function () { - $('#edit-editor-settings-plugins-drupalimage').drupalSetSummary(function (context) { + $('[data-ckeditor-plugin-id="drupalimage"]').drupalSetSummary(function (context) { var root = 'input[name="editor[settings][plugins][drupalimage][image_upload]'; var $status = $(root + '[status]"]'); var $maxFileSize = $(root + '[max_size]"]'); diff -u b/core/modules/ckeditor/js/ckeditor.stylescombo.admin.js b/core/modules/ckeditor/js/ckeditor.stylescombo.admin.js --- b/core/modules/ckeditor/js/ckeditor.stylescombo.admin.js +++ b/core/modules/ckeditor/js/ckeditor.stylescombo.admin.js @@ -26,14 +26,14 @@ var that = this; $context.find('[name="editor[settings][plugins][stylescombo][styles]"]') .on('blur.ckeditorStylesComboSettings', function () { - var styles = $.trim($(this).val()); + var styles = $.trim($('#edit-editor-settings-plugins-stylescombo-styles').val()); var stylesSet = that._generateStylesSetSetting(styles); if (!_.isEqual(previousStylesSet, stylesSet)) { previousStylesSet = stylesSet; var that = this; $context.find('[name="editor[settings][plugins][stylescombo][styles]"]') .on('blur.ckeditorStylesComboSettings', function () { - var styles = $.trim($('#edit-editor-settings-plugins-stylescombo-styles').val()); + var styles = $.trim($(this).val()); var stylesSet = that._generateStylesSetSetting(styles); if (!_.isEqual(previousStylesSet, stylesSet)) { previousStylesSet = stylesSet; @@ -96,8 +96,8 @@ */ Drupal.behaviors.ckeditorStylesComboSettingsSummary = { attach: function () { - $('[data-ckeditor-plugin-id="stylescombo"]').drupalSetSummary(function (context) { - var styles = $.trim($('[name="editor[settings][plugins][stylescombo][styles]"]').val()); + $('#edit-editor-settings-plugins-stylescombo').drupalSetSummary(function (context) { + var styles = $.trim($('#edit-editor-settings-plugins-stylescombo-styles').val()); if (styles.length === 0) { return Drupal.t('No styles configured'); } @@ -105,8 +105,8 @@ */ Drupal.behaviors.ckeditorStylesComboSettingsSummary = { attach: function () { - $('#edit-editor-settings-plugins-stylescombo').drupalSetSummary(function (context) { - var styles = $.trim($('#edit-editor-settings-plugins-stylescombo-styles').val()); + $('[data-ckeditor-plugin-id="stylescombo"]').drupalSetSummary(function (context) { + var styles = $.trim($('[data-drupal-selector="edit-editor-settings-plugins-stylescombo-styles"]').val()); if (styles.length === 0) { return Drupal.t('No styles configured'); } reverted: --- b/core/modules/ckeditor/src/Plugin/Editor/CKEditor.php +++ a/core/modules/ckeditor/src/Plugin/Editor/CKEditor.php @@ -165,7 +165,6 @@ '#title' => t('CKEditor plugin settings'), '#attributes' => array( 'id' => 'ckeditor-plugin-settings', - 'data-drupal-selector' => 'ckeditor-plugin-settings', ), ); $this->ckeditorPluginManager->injectPluginSettingsForm($form, $form_state, $editor); diff -u b/core/modules/field_ui/field_ui.js b/core/modules/field_ui/field_ui.js --- b/core/modules/field_ui/field_ui.js +++ b/core/modules/field_ui/field_ui.js @@ -61,7 +61,7 @@ */ Drupal.behaviors.fieldUIDisplayOverview = { attach: function (context, settings) { - $(context).find('[data-drupal-selector="field-display-overview"]').once('field-display-overview').each(function () { + $(context).find('table#field-display-overview').once('field-display-overview').each(function () { Drupal.fieldUIOverview.attach(this, settings.fieldUIRowsData, Drupal.fieldUIDisplayOverview); }); } @@ -214,7 +214,7 @@ // Fire the Ajax update. $('input[name=refresh_rows]').val(rowNames.join(' ')); - $('input[data-drupal-selector="field-ui-refresh"]').trigger('mousedown'); + $('input[data-drupal-selector="edit-refresh"]').trigger('mousedown'); // Disabled elements do not appear in POST ajax data, so we mark the // elements disabled only after firing the request. reverted: --- b/core/modules/field_ui/src/Form/EntityDisplayFormBase.php +++ a/core/modules/field_ui/src/Form/EntityDisplayFormBase.php @@ -167,7 +167,6 @@ '#attributes' => array( 'class' => array('field-ui-overview'), 'id' => 'field-display-overview', - 'data-drupal-selector' => 'field-display-overview', ), // Add Ajax wrapper. '#prefix' => '