Update Composer, update everything
This commit is contained in:
parent
ea3e94409f
commit
dda5c284b6
19527 changed files with 1135420 additions and 351004 deletions
web/core/modules/layout_builder/js
54
web/core/modules/layout_builder/js/layout-builder.es6.js
Normal file
54
web/core/modules/layout_builder/js/layout-builder.es6.js
Normal file
|
@ -0,0 +1,54 @@
|
|||
(($, { ajax, behaviors }) => {
|
||||
behaviors.layoutBuilder = {
|
||||
attach(context) {
|
||||
$(context)
|
||||
.find('.layout-builder--layout__region')
|
||||
.sortable({
|
||||
items: '> .draggable',
|
||||
connectWith: '.layout-builder--layout__region',
|
||||
placeholder: 'ui-state-drop',
|
||||
|
||||
/**
|
||||
* Updates the layout with the new position of the block.
|
||||
*
|
||||
* @param {jQuery.Event} event
|
||||
* The jQuery Event object.
|
||||
* @param {Object} ui
|
||||
* An object containing information about the item being sorted.
|
||||
*/
|
||||
update(event, ui) {
|
||||
// Check if the region from the event and region for the item match.
|
||||
const itemRegion = ui.item.closest(
|
||||
'.layout-builder--layout__region',
|
||||
);
|
||||
if (event.target === itemRegion[0]) {
|
||||
// Find the destination delta.
|
||||
const deltaTo = ui.item
|
||||
.closest('[data-layout-delta]')
|
||||
.data('layout-delta');
|
||||
// If the block didn't leave the original delta use the destination.
|
||||
const deltaFrom = ui.sender
|
||||
? ui.sender.closest('[data-layout-delta]').data('layout-delta')
|
||||
: deltaTo;
|
||||
ajax({
|
||||
url: [
|
||||
ui.item
|
||||
.closest('[data-layout-update-url]')
|
||||
.data('layout-update-url'),
|
||||
deltaFrom,
|
||||
deltaTo,
|
||||
itemRegion.data('region'),
|
||||
ui.item.data('layout-block-uuid'),
|
||||
ui.item
|
||||
.prev('[data-layout-block-uuid]')
|
||||
.data('layout-block-uuid'),
|
||||
]
|
||||
.filter(element => element !== undefined)
|
||||
.join('/'),
|
||||
}).execute();
|
||||
}
|
||||
},
|
||||
});
|
||||
},
|
||||
};
|
||||
})(jQuery, Drupal);
|
35
web/core/modules/layout_builder/js/layout-builder.js
Normal file
35
web/core/modules/layout_builder/js/layout-builder.js
Normal file
|
@ -0,0 +1,35 @@
|
|||
/**
|
||||
* DO NOT EDIT THIS FILE.
|
||||
* See the following change record for more information,
|
||||
* https://www.drupal.org/node/2815083
|
||||
* @preserve
|
||||
**/
|
||||
|
||||
(function ($, _ref) {
|
||||
var ajax = _ref.ajax,
|
||||
behaviors = _ref.behaviors;
|
||||
|
||||
behaviors.layoutBuilder = {
|
||||
attach: function attach(context) {
|
||||
$(context).find('.layout-builder--layout__region').sortable({
|
||||
items: '> .draggable',
|
||||
connectWith: '.layout-builder--layout__region',
|
||||
placeholder: 'ui-state-drop',
|
||||
|
||||
update: function update(event, ui) {
|
||||
var itemRegion = ui.item.closest('.layout-builder--layout__region');
|
||||
if (event.target === itemRegion[0]) {
|
||||
var deltaTo = ui.item.closest('[data-layout-delta]').data('layout-delta');
|
||||
|
||||
var deltaFrom = ui.sender ? ui.sender.closest('[data-layout-delta]').data('layout-delta') : deltaTo;
|
||||
ajax({
|
||||
url: [ui.item.closest('[data-layout-update-url]').data('layout-update-url'), deltaFrom, deltaTo, itemRegion.data('region'), ui.item.data('layout-block-uuid'), ui.item.prev('[data-layout-block-uuid]').data('layout-block-uuid')].filter(function (element) {
|
||||
return element !== undefined;
|
||||
}).join('/')
|
||||
}).execute();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
})(jQuery, Drupal);
|
Reference in a new issue