Skip to content
Snippets Groups Projects
Commit 67ef7549 authored by Seth Hill's avatar Seth Hill
Browse files

Issue #3465076: use es6 as default and rename to .js

parent ad117e41
No related branches found
No related tags found
No related merge requests found
Pipeline #256257 failed
(($, Drupal, once) => {
// Updates the "Close" button label when a layout is changed.
Drupal.behaviors.layoutParagraphsBuilderForm = {
attach: function attach(context) {
// Prevent nested frontend editors from being activated at the same time.
$('.lpb-enable__wrapper').removeClass('hidden');
$('[data-lpb-form-id]').each((i, e) => {
const p = $(e).parents('[data-lpb-id]').toArray().pop();
const parent = p || e;
$('.lpb-enable__wrapper', parent).addClass('hidden');
});
// Update the "Close" button to say "Cancel" when any changes are made.
const events = [
'lpb-component:insert.lpb',
'lpb-component:update.lpb',
'lpb-component:move.lpb',
'lpb-component:drop.lpb',
].join(' ');
$(once('lpb-builder-form', '[data-lpb-id]', context))
.on(events, (e) => {
$(e.currentTarget)
.closest('[data-lpb-form-id]')
.find('[data-drupal-selector="edit-close"]')
.val(Drupal.t('Cancel'));
});
},
};
})(jQuery, Drupal, once);
/**
* DO NOT EDIT THIS FILE.
* See the following change record for more information,
* https://www.drupal.org/node/2815083
* @preserve
**/
"use strict";
(function ($, Drupal, once) {
(($, Drupal, once) => {
// Updates the "Close" button label when a layout is changed.
Drupal.behaviors.layoutParagraphsBuilderForm = {
attach: function attach(context) {
// Prevent nested frontend editors from being activated at the same time.
$('.lpb-enable__wrapper').removeClass('hidden');
$('[data-lpb-form-id]').each(function (i, e) {
var p = $(e).parents('[data-lpb-id]').toArray().pop();
var parent = p || e;
$('[data-lpb-form-id]').each((i, e) => {
const p = $(e).parents('[data-lpb-id]').toArray().pop();
const parent = p || e;
$('.lpb-enable__wrapper', parent).addClass('hidden');
});
var events = ['lpb-component:insert.lpb', 'lpb-component:update.lpb', 'lpb-component:move.lpb', 'lpb-component:drop.lpb'].join(' ');
$(once('lpb-builder-form', '[data-lpb-id]', context)).on(events, function (e) {
$(e.currentTarget).closest('[data-lpb-form-id]').find('[data-drupal-selector="edit-close"]').val(Drupal.t('Cancel'));
});
}
// Update the "Close" button to say "Cancel" when any changes are made.
const events = [
'lpb-component:insert.lpb',
'lpb-component:update.lpb',
'lpb-component:move.lpb',
'lpb-component:drop.lpb',
].join(' ');
$(once('lpb-builder-form', '[data-lpb-id]', context))
.on(events, (e) => {
$(e.currentTarget)
.closest('[data-lpb-form-id]')
.find('[data-drupal-selector="edit-close"]')
.val(Drupal.t('Cancel'));
});
},
};
})(jQuery, Drupal, once);
\ No newline at end of file
})(jQuery, Drupal, once);
This diff is collapsed.
This diff is collapsed.
(function ($, Drupal) {
Drupal.behaviors.layoutParagraphsComponentForm = {
attach: function attach(context) {
// The layout selection element uses AJAX to load the layout config form.
// We need to disable the save button while waiting for the AJAX request,
// to prevent race UI condition.
// @see https://www.drupal.org/project/layout_paragraphs/issues/3265669
$('[name="layout_paragraphs[layout]"]').on('change', (e) => {
$('.lpb-btn--save').prop('disabled', e.currentTarget.disabled);
});
// Re-enable the component form save button when the behavior reattaches,
// which will happen once the AJAX request completes.
$('.lpb-btn--save').prop('disabled', false);
}
}
})(jQuery, Drupal);
/**
* DO NOT EDIT THIS FILE.
* See the following change record for more information,
* https://www.drupal.org/node/2815083
* @preserve
**/
"use strict";
(function ($, Drupal) {
Drupal.behaviors.layoutParagraphsComponentForm = {
attach: function attach(context) {
$('[name="layout_paragraphs[layout]"]').on('change', function (e) {
// The layout selection element uses AJAX to load the layout config form.
// We need to disable the save button while waiting for the AJAX request,
// to prevent race UI condition.
// @see https://www.drupal.org/project/layout_paragraphs/issues/3265669
$('[name="layout_paragraphs[layout]"]').on('change', (e) => {
$('.lpb-btn--save').prop('disabled', e.currentTarget.disabled);
});
// Re-enable the component form save button when the behavior reattaches,
// which will happen once the AJAX request completes.
$('.lpb-btn--save').prop('disabled', false);
}
};
})(jQuery, Drupal);
\ No newline at end of file
}
})(jQuery, Drupal);
(($, Drupal) => {
Drupal.behaviors.layoutParagraphsComponentList = {
attach: function attach(context) {
$('.lpb-component-list-search-input', context).keyup((e) => {
const v = e.currentTarget.value;
const pattern = new RegExp(v, 'i');
const $list = $(e.currentTarget)
.closest('.lpb-component-list')
.find('.lpb-component-list__item');
$list.each((i, item) => {
if (pattern.test(item.innerText)) {
item.removeAttribute('style');
} else {
item.style.display = 'none';
}
});
});
},
};
})(jQuery, Drupal);
/**
* DO NOT EDIT THIS FILE.
* See the following change record for more information,
* https://www.drupal.org/node/2815083
* @preserve
**/
"use strict";
(function ($, Drupal) {
(($, Drupal) => {
Drupal.behaviors.layoutParagraphsComponentList = {
attach: function attach(context) {
$('.lpb-component-list-search-input', context).keyup(function (e) {
var v = e.currentTarget.value;
var pattern = new RegExp(v, 'i');
var $list = $(e.currentTarget).closest('.lpb-component-list').find('.lpb-component-list__item');
$list.each(function (i, item) {
$('.lpb-component-list-search-input', context).keyup((e) => {
const v = e.currentTarget.value;
const pattern = new RegExp(v, 'i');
const $list = $(e.currentTarget)
.closest('.lpb-component-list')
.find('.lpb-component-list__item');
$list.each((i, item) => {
if (pattern.test(item.innerText)) {
item.removeAttribute('style');
} else {
......@@ -21,6 +15,6 @@
}
});
});
}
},
};
})(jQuery, Drupal);
\ No newline at end of file
})(jQuery, Drupal);
name: 'Layout Paragraphs'
type: module
description: 'Field widget and formatter for using layouts with paragraph fields.'
core_version_requirement: ^9.2 || ^10 || ^11
core_version_requirement: ^10 || ^11
package: 'Paragraphs'
configure: layout_paragraphs.label_settings
dependencies:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment