Update to Drupal 8.2.6. For more information, see https://www.drupal.org/project/drupal/releases/8.2.6
This commit is contained in:
parent
db56c09587
commit
f1e72395cb
588 changed files with 26857 additions and 2777 deletions
|
|
@ -11,6 +11,10 @@
|
|||
|
||||
'use strict';
|
||||
|
||||
// The minimum width to use body displace needs to match the width at which
|
||||
// the tray will be %100 width. @see outside_in.module.css
|
||||
var minDisplaceWidth = 768;
|
||||
|
||||
/**
|
||||
* The edge of the screen that the dialog should appear on.
|
||||
*
|
||||
|
|
@ -18,7 +22,7 @@
|
|||
*/
|
||||
var edge = document.documentElement.dir === 'rtl' ? 'left' : 'right';
|
||||
|
||||
var $mainCanvasWrapper = $('#main-canvas-wrapper');
|
||||
var $mainCanvasWrapper = $('[data-offcanvas-main-canvas]');
|
||||
|
||||
/**
|
||||
* Resets the size of the dialog.
|
||||
|
|
@ -47,7 +51,7 @@
|
|||
|
||||
$element
|
||||
.dialog('option', adjustedOptions)
|
||||
.trigger('dialogContentResize.outsidein');
|
||||
.trigger('dialogContentResize.offcanvas');
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -81,6 +85,9 @@
|
|||
* The event triggered.
|
||||
*/
|
||||
function bodyPadding(event) {
|
||||
if ($('body').outerWidth() < minDisplaceWidth) {
|
||||
return;
|
||||
}
|
||||
var $element = event.data.$element;
|
||||
var $widget = $element.dialog('widget');
|
||||
|
||||
|
|
@ -100,26 +107,28 @@
|
|||
$('.ui-dialog-offcanvas, .ui-dialog-offcanvas .ui-dialog-titlebar').toggleClass('ui-dialog-empty-title', !settings.title);
|
||||
|
||||
$element
|
||||
.on('dialogresize.outsidein', eventData, debounce(bodyPadding, 100))
|
||||
.on('dialogContentResize.outsidein', eventData, handleDialogResize)
|
||||
.trigger('dialogresize.outsidein');
|
||||
.on('dialogresize.offcanvas', eventData, debounce(bodyPadding, 100))
|
||||
.on('dialogContentResize.offcanvas', eventData, handleDialogResize)
|
||||
.on('dialogContentResize.offcanvas', eventData, debounce(bodyPadding, 100))
|
||||
.trigger('dialogresize.offcanvas');
|
||||
|
||||
$element.dialog('widget').attr('data-offset-' + edge, '');
|
||||
|
||||
$(window)
|
||||
.on('resize.outsidein scroll.outsidein', eventData, debounce(resetSize, 100))
|
||||
.trigger('resize.outsidein');
|
||||
.on('resize.offcanvas scroll.offcanvas', eventData, debounce(resetSize, 100))
|
||||
.trigger('resize.offcanvas');
|
||||
}
|
||||
},
|
||||
'dialog:beforecreate': function (event, dialog, $element, settings) {
|
||||
if ($element.is('#drupal-offcanvas')) {
|
||||
$('body').addClass('js-tray-open');
|
||||
// @see http://api.jqueryui.com/position/
|
||||
settings.position = {
|
||||
my: 'left top',
|
||||
at: edge + ' top',
|
||||
of: window
|
||||
};
|
||||
settings.dialogClass = 'ui-dialog-offcanvas';
|
||||
settings.dialogClass += ' ui-dialog-offcanvas';
|
||||
// Applies initial height to dialog based on window height.
|
||||
// See http://api.jqueryui.com/dialog for all dialog options.
|
||||
settings.height = $(window).height();
|
||||
|
|
@ -127,8 +136,9 @@
|
|||
},
|
||||
'dialog:beforeclose': function (event, dialog, $element) {
|
||||
if ($element.is('#drupal-offcanvas')) {
|
||||
$(document).off('.outsidein');
|
||||
$(window).off('.outsidein');
|
||||
$('body').removeClass('js-tray-open');
|
||||
$(document).off('.offcanvas');
|
||||
$(window).off('.offcanvas');
|
||||
$mainCanvasWrapper.css('padding-' + edge, 0);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Reference in a new issue