Issue #3088681 by phenaproxima, seanB, bnjmnm, lauriii: Make MediaLibraryTest less dependent on representational CSS selectors
(cherry picked from commit 1aaa1d95e0
)
merge-requests/64/head
parent
aa9d5a31dd
commit
ff9dbe9b21
|
@ -58,7 +58,7 @@
|
|||
? strings.hide
|
||||
: strings.show,
|
||||
)
|
||||
.parent()
|
||||
.closest('.js-media-library-widget')
|
||||
.find('.js-media-library-item-weight')
|
||||
.parent()
|
||||
.toggle();
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
};
|
||||
$('.js-media-library-widget-toggle-weight', context).once('media-library-toggle').on('click', function (e) {
|
||||
e.preventDefault();
|
||||
$(e.currentTarget).toggleClass('active').text($(e.currentTarget).hasClass('active') ? strings.hide : strings.show).parent().find('.js-media-library-item-weight').parent().toggle();
|
||||
$(e.currentTarget).toggleClass('active').text($(e.currentTarget).hasClass('active') ? strings.hide : strings.show).closest('.js-media-library-widget').find('.js-media-library-item-weight').parent().toggle();
|
||||
}).text(strings.show);
|
||||
$('.js-media-library-item-weight', context).once('media-library-toggle').parent().hide();
|
||||
}
|
||||
|
|
|
@ -173,6 +173,7 @@ abstract class AddFormBase extends FormBase {
|
|||
'#type' => 'container',
|
||||
'#attributes' => [
|
||||
'class' => [
|
||||
'js-media-library-add-form-added-media',
|
||||
'media-library-add-form__added-media',
|
||||
],
|
||||
'aria-label' => $this->t('Added media items'),
|
||||
|
|
|
@ -317,7 +317,7 @@ class MediaLibraryWidget extends WidgetBase implements ContainerFactoryPluginInt
|
|||
'#target_bundles' => isset($settings['target_bundles']) ? $settings['target_bundles'] : FALSE,
|
||||
'#attributes' => [
|
||||
'id' => $wrapper_id,
|
||||
'class' => ['media-library-widget'],
|
||||
'class' => ['js-media-library-widget', 'media-library-widget'],
|
||||
],
|
||||
'#attached' => [
|
||||
'library' => ['media_library/widget'],
|
||||
|
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue