Issue #2905922 by tim.plunkett, tedbow, xjm, EclipseGc, webchick, vijaycs85, larowlan, andrewmacpherson, droplet, Bojhan, mgifford, drpal, phenaproxima, DyanneNova, japerry: Implementation issue for Layout Builder
2017-11-17 19:01:26 +00:00
|
|
|
/**
|
|
|
|
* 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',
|
|
|
|
|
|
|
|
update: function update(event, ui) {
|
2018-01-26 20:50:00 +00:00
|
|
|
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;
|
Issue #2905922 by tim.plunkett, tedbow, xjm, EclipseGc, webchick, vijaycs85, larowlan, andrewmacpherson, droplet, Bojhan, mgifford, drpal, phenaproxima, DyanneNova, japerry: Implementation issue for Layout Builder
2017-11-17 19:01:26 +00:00
|
|
|
ajax({
|
2018-01-26 20:50:00 +00:00
|
|
|
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) {
|
Issue #2905922 by tim.plunkett, tedbow, xjm, EclipseGc, webchick, vijaycs85, larowlan, andrewmacpherson, droplet, Bojhan, mgifford, drpal, phenaproxima, DyanneNova, japerry: Implementation issue for Layout Builder
2017-11-17 19:01:26 +00:00
|
|
|
return element !== undefined;
|
|
|
|
}).join('/')
|
|
|
|
}).execute();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
};
|
|
|
|
})(jQuery, Drupal);
|