diff --git a/core/misc/vertical-tabs.js b/core/misc/vertical-tabs.js index 1b51850..e7f64dc 100644 --- a/core/misc/vertical-tabs.js +++ b/core/misc/vertical-tabs.js @@ -149,7 +149,7 @@ // Display the tab. this.item.show(); // Show the vertical tabs. - this.item.closest('.form-type-vertical-tabs').show(); + this.item.closest('.js-form-type-vertical-tabs').show(); // Update .first marker for items. We need recurse from parent to retain the // actual DOM element order as jQuery implements sortOrder, but not as public // method. @@ -182,7 +182,7 @@ } // Hide the vertical tabs (if no tabs remain). else { - this.item.closest('.form-type-vertical-tabs').hide(); + this.item.closest('.js-form-type-vertical-tabs').hide(); } return this; } diff --git a/core/modules/locale/config/optional/tour.tour.locale.yml b/core/modules/locale/config/optional/tour.tour.locale.yml index e3f6d8d..0fe00d1 100644 --- a/core/modules/locale/config/optional/tour.tour.locale.yml +++ b/core/modules/locale/config/optional/tour.tour.locale.yml @@ -55,7 +55,7 @@ tips: body: 'You can write your own translation in the text fields of the right column. Try to figure out in which context the text will be used in order to translate it in the appropriate way.' weight: 6 attributes: - data-class: form-type-textarea + data-class: js-form-type-textarea locale-validate: id: locale-validate diff --git a/core/modules/options/src/Tests/OptionsWidgetsTest.php b/core/modules/options/src/Tests/OptionsWidgetsTest.php index b8cf90e..e630d95 100644 --- a/core/modules/options/src/Tests/OptionsWidgetsTest.php +++ b/core/modules/options/src/Tests/OptionsWidgetsTest.php @@ -477,8 +477,8 @@ function testEmptyValue() { // Display form: check that _none options are present and has label. $this->drupalGet('entity_test/manage/' . $entity->id()); - $this->assertTrue($this->xpath('//div[@id=:id]//div[@class=:class]//input[@value=:value]', array(':id' => 'edit-card-1', ':class' => 'form-item form-type-radio form-item-card-1', ':value' => '_none')), 'A test radio button has a "None" choice.'); - $this->assertTrue($this->xpath('//div[@id=:id]//div[@class=:class]//label[@for=:for and text()=:label]', array(':id' => 'edit-card-1', ':class' => 'form-item form-type-radio form-item-card-1', ':for' => 'edit-card-1-none', ':label' => 'N/A')), 'A test radio button has a "N/A" choice.'); + $this->assertTrue($this->xpath('//div[@id=:id]//div[@class=:class]//input[@value=:value]', array(':id' => 'edit-card-1', ':class' => 'form-item js-form-type-radio form-type-radio form-item-card-1', ':value' => '_none')), 'A test radio button has a "None" choice.'); + $this->assertTrue($this->xpath('//div[@id=:id]//div[@class=:class]//label[@for=:for and text()=:label]', array(':id' => 'edit-card-1', ':class' => 'form-item js-form-type-radio form-type-radio form-item-card-1', ':for' => 'edit-card-1-none', ':label' => 'N/A')), 'A test radio button has a "N/A" choice.'); // Change it to the select widget. entity_get_form_display('entity_test', 'entity_test', 'default') diff --git a/core/modules/system/src/Tests/Common/RenderWebTest.php b/core/modules/system/src/Tests/Common/RenderWebTest.php index c5b1152..f88a13d 100644 --- a/core/modules/system/src/Tests/Common/RenderWebTest.php +++ b/core/modules/system/src/Tests/Common/RenderWebTest.php @@ -91,7 +91,7 @@ function testDrupalRenderFormElements() { '#markup' => $this->randomMachineName(), ); $this->assertRenderedElement($element, '//div[contains(@class, :class) and contains(., :markup)]/label[contains(., :label)]', array( - ':class' => 'form-type-item', + ':class' => 'js-form-type-item', ':markup' => $element['#markup'], ':label' => $element['#title'], )); @@ -138,7 +138,7 @@ function testDrupalRenderFormElements() { '#markup' => $this->randomMachineName(), ); $this->assertRenderedElement($element, '//details/div/div[contains(@class, :class) and contains(., :markup)]', array( - ':class' => 'form-type-item', + ':class' => 'js-form-type-item', ':markup' => $element['item']['#markup'], )); } diff --git a/core/modules/system/templates/form-element.html.twig b/core/modules/system/templates/form-element.html.twig index a961801..dbbb830 100644 --- a/core/modules/system/templates/form-element.html.twig +++ b/core/modules/system/templates/form-element.html.twig @@ -48,7 +48,7 @@ {% set classes = [ 'form-item', - 'form-type-' ~ type|clean_class, + 'js-form-type-' ~ type|clean_class, 'form-item-' ~ name|clean_class, title_display not in ['after', 'before'] ? 'form-no-label', disabled == 'disabled' ? 'form-disabled', diff --git a/core/modules/views_ui/js/views-admin.js b/core/modules/views_ui/js/views-admin.js index 7f217dc..b71c1d7 100644 --- a/core/modules/views_ui/js/views-admin.js +++ b/core/modules/views_ui/js/views-admin.js @@ -786,7 +786,7 @@ }); }); // Uncheck the select all checkbox if any of the others are unchecked. - $('#views-ui-handler-form').find('div.form-type-checkbox').not($('.form-item-options-value-all')) + $('#views-ui-handler-form').find('div.js-form-type-checkbox').not($('.form-item-options-value-all')) .find('input[type=checkbox]') .on('click', function () { if ($(this).is('checked') === false) { diff --git a/core/themes/classy/templates/form/form-element.html.twig b/core/themes/classy/templates/form/form-element.html.twig index cf54c20..5dc4000 100644 --- a/core/themes/classy/templates/form/form-element.html.twig +++ b/core/themes/classy/templates/form/form-element.html.twig @@ -46,6 +46,7 @@ {% set classes = [ 'form-item', + 'js-form-type-' ~ type|clean_class, 'form-type-' ~ type|clean_class, 'form-item-' ~ name|clean_class, title_display not in ['after', 'before'] ? 'form-no-label',