Issue #3023311 by bnjmnm, huzooka, kostyashupenko, boulaffasae, nod_, mrinalini9, codersukanta, lauriii, fhaeberle, ckrina, Peter Majmesku, andrewmacpherson, saschaeggi, antonellasevero, DyanneNova, thekishanraval: Modal dialog style update
2020-06-11 12:01:21 +00:00
|
|
|
/**
|
|
|
|
* DO NOT EDIT THIS FILE.
|
|
|
|
* See the following change record for more information,
|
|
|
|
* https://www.drupal.org/node/2815083
|
|
|
|
* @preserve
|
|
|
|
**/
|
|
|
|
|
2021-12-18 06:12:16 +00:00
|
|
|
(($, Drupal, window) => {
|
Issue #3023311 by bnjmnm, huzooka, kostyashupenko, boulaffasae, nod_, mrinalini9, codersukanta, lauriii, fhaeberle, ckrina, Peter Majmesku, andrewmacpherson, saschaeggi, antonellasevero, DyanneNova, thekishanraval: Modal dialog style update
2020-06-11 12:01:21 +00:00
|
|
|
Drupal.behaviors.MediaLibraryItemSelectionClaro = {
|
2021-12-18 06:12:16 +00:00
|
|
|
attach() {
|
2021-08-10 10:05:02 +00:00
|
|
|
if (!once('media-library-selection-info-claro-event', 'html').length) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2021-12-18 06:12:16 +00:00
|
|
|
$(window).on('dialog:aftercreate', (event, dialog, $element, settings) => {
|
|
|
|
const moveCounter = ($selectedCount, $buttonPane) => {
|
|
|
|
const $moveSelectedCount = $selectedCount.detach();
|
Issue #3023311 by bnjmnm, huzooka, kostyashupenko, boulaffasae, nod_, mrinalini9, codersukanta, lauriii, fhaeberle, ckrina, Peter Majmesku, andrewmacpherson, saschaeggi, antonellasevero, DyanneNova, thekishanraval: Modal dialog style update
2020-06-11 12:01:21 +00:00
|
|
|
$buttonPane.prepend($moveSelectedCount);
|
|
|
|
};
|
|
|
|
|
2021-12-18 06:12:16 +00:00
|
|
|
const $buttonPane = $element.closest('.media-library-widget-modal').find('.ui-dialog-buttonpane');
|
Issue #3023311 by bnjmnm, huzooka, kostyashupenko, boulaffasae, nod_, mrinalini9, codersukanta, lauriii, fhaeberle, ckrina, Peter Majmesku, andrewmacpherson, saschaeggi, antonellasevero, DyanneNova, thekishanraval: Modal dialog style update
2020-06-11 12:01:21 +00:00
|
|
|
|
|
|
|
if (!$buttonPane.length) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2021-12-18 06:12:16 +00:00
|
|
|
const $selectedCount = $buttonPane.find('.js-media-library-selected-count');
|
Issue #3023311 by bnjmnm, huzooka, kostyashupenko, boulaffasae, nod_, mrinalini9, codersukanta, lauriii, fhaeberle, ckrina, Peter Majmesku, andrewmacpherson, saschaeggi, antonellasevero, DyanneNova, thekishanraval: Modal dialog style update
2020-06-11 12:01:21 +00:00
|
|
|
|
|
|
|
if ($selectedCount.length) {
|
|
|
|
moveCounter($selectedCount, $buttonPane);
|
|
|
|
} else {
|
2021-12-18 06:12:16 +00:00
|
|
|
const selectedCountObserver = new MutationObserver(() => {
|
|
|
|
const $selectedCountFind = $buttonPane.find('.js-media-library-selected-count');
|
Issue #3023311 by bnjmnm, huzooka, kostyashupenko, boulaffasae, nod_, mrinalini9, codersukanta, lauriii, fhaeberle, ckrina, Peter Majmesku, andrewmacpherson, saschaeggi, antonellasevero, DyanneNova, thekishanraval: Modal dialog style update
2020-06-11 12:01:21 +00:00
|
|
|
|
|
|
|
if ($selectedCountFind.length) {
|
|
|
|
moveCounter($selectedCountFind, $buttonPane);
|
|
|
|
selectedCountObserver.disconnect();
|
|
|
|
}
|
|
|
|
});
|
|
|
|
selectedCountObserver.observe($buttonPane[0], {
|
|
|
|
attributes: false,
|
|
|
|
childList: true,
|
|
|
|
characterData: false,
|
|
|
|
subtree: true
|
|
|
|
});
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
2021-12-18 06:12:16 +00:00
|
|
|
|
Issue #3023311 by bnjmnm, huzooka, kostyashupenko, boulaffasae, nod_, mrinalini9, codersukanta, lauriii, fhaeberle, ckrina, Peter Majmesku, andrewmacpherson, saschaeggi, antonellasevero, DyanneNova, thekishanraval: Modal dialog style update
2020-06-11 12:01:21 +00:00
|
|
|
};
|
|
|
|
})(jQuery, Drupal, window);
|