diff --git a/core/modules/outside_in/js/off-canvas.es6.js b/core/modules/outside_in/js/off-canvas.es6.js index 0ff31bc..1a16255 100644 --- a/core/modules/outside_in/js/off-canvas.es6.js +++ b/core/modules/outside_in/js/off-canvas.es6.js @@ -19,17 +19,20 @@ * Attaches event listeners for off-canvas dialogs. */ Drupal.offCanvas = { + /** * 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 * @type {Number} */ minDisplaceWidth: 768, + /** * Wrapper used to position off-canvas dialog. * @type {jQuery} */ $mainCanvasWrapper: $('[data-off-canvas-main-canvas]'), + /** * Determines if an element is an off-canvas dialog. * @@ -41,6 +44,7 @@ isOffCanvas($element) { return $element.is('#drupal-off-canvas'); }, + /** * Handler fired before an off-canvas dialog has been opened. * @param {Object} settings @@ -56,10 +60,12 @@ at: `${Drupal.offCanvas.getEdge()} top`, of: window, }; + // Applies initial height to dialog based on window height. // See http://api.jqueryui.com/dialog for all dialog options. settings.height = $(window).height(); }, + /** * Handler fired after an off-canvas dialog has been closed. * @return {undefined} @@ -71,6 +77,7 @@ $(window).off('.off-canvas'); Drupal.offCanvas.$mainCanvasWrapper.css(`padding-${Drupal.offCanvas.getEdge()}`, 0); }, + /** * Handler fired when an off-canvas dialog has been opened. * @param {jQuery} $element @@ -94,6 +101,7 @@ .on('resize.off-canvas scroll.off-canvas', eventData, debounce(Drupal.offCanvas.resetSize, 100)) .trigger('resize.off-canvas'); }, + /** * Toggle classes based on title existence. * Called with Drupal.offCanvas.afterCreate. @@ -104,6 +112,7 @@ render(settings) { $('.ui-dialog-off-canvas, .ui-dialog-off-canvas .ui-dialog-titlebar').toggleClass('ui-dialog-empty-title', !settings.title); }, + /** * Adjusts the dialog on resize. * @@ -131,6 +140,7 @@ const scrollOffset = $element.outerHeight() - $element.height(); $element.height(modalHeight - offset - scrollOffset); }, + /** * Resets the size of the dialog. * @@ -163,6 +173,7 @@ .dialog('option', adjustedOptions) .trigger('dialogContentResize.off-canvas'); }, + /** * Adjusts the body padding when the dialog is resized. * @@ -187,6 +198,7 @@ displace(); } }, + /** * The HTML element that surrounds the dialog. * @param {HTMLElement} $element @@ -198,6 +210,7 @@ getContainer($element) { return $element.dialog('widget'); }, + /** * The edge of the screen that the dialog should appear on. *