diff --git a/core/modules/outside_in/css/offcanvas.css b/core/modules/outside_in/css/off-canvas.css similarity index 51% rename from core/modules/outside_in/css/offcanvas.css rename to core/modules/outside_in/css/off-canvas.css index fb671dbbf377e042a3d3dd37763aa7ccdf4596f9..05ab5398742eca323dccd19b40609579e8347589 100644 --- a/core/modules/outside_in/css/offcanvas.css +++ b/core/modules/outside_in/css/off-canvas.css @@ -1,23 +1,23 @@ /** * @file - * CSS for Offcanvas tray. + * CSS for off-canvas dialog. * * @todo Move CSS into core dialog library https://www.drupal.org/node/2784443. */ -/* Position the dialog-offcanvas tray container outside the right of the viewport. */ -.ui-dialog-offcanvas { +/* Position the off-canvas dialog container outside the right of the viewport. */ +.ui-dialog-off-canvas { box-sizing: border-box; height: 100%; overflow: visible; } -/* Wrap the form that's inside the dialog-offcanvas tray. */ -.ui-dialog-offcanvas .ui-dialog-content { +/* Wrap the form that's inside the off-canvas dialog. */ +.ui-dialog-off-canvas .ui-dialog-content { padding: 0 20px; /* Prevent horizontal scrollbar. */ overflow-x: hidden; overflow-y: auto; } -[dir="rtl"] .ui-dialog-offcanvas .ui-dialog-content { +[dir="rtl"] .ui-dialog-off-canvas .ui-dialog-content { text-align: right; } diff --git a/core/modules/outside_in/css/offcanvas.motion.css b/core/modules/outside_in/css/off-canvas.motion.css similarity index 72% rename from core/modules/outside_in/css/offcanvas.motion.css rename to core/modules/outside_in/css/off-canvas.motion.css index 1c069940717bad7d433469317488a35e5868a457..a6217eec720f2701fb04ca8939ea5697c1cb9678 100644 --- a/core/modules/outside_in/css/offcanvas.motion.css +++ b/core/modules/outside_in/css/off-canvas.motion.css @@ -1,6 +1,6 @@ /** * @file - * Motion effects for off-canvas tray dialog. + * Motion effects for off-canvas dialog. * * Motion effects are in a separate file so that they can be easily turned off * to improve performance if desired. @@ -10,22 +10,22 @@ * file: https://www.drupal.org/node/2784443. */ -/* Transition the dialog-offcanvas tray container, with 2s delay to match main canvas speed. */ -.ui-dialog-offcanvas .ui-dialog-content { +/* Transition the off-canvas dialog container, with 2s delay to match main canvas speed. */ +.ui-dialog-off-canvas .ui-dialog-content { -webkit-transition: all .7s ease 2s; -moz-transition: all .7s ease 2s; transition: all .7s ease 2s; } @media (max-width: 700px) { - .ui-dialog-offcanvas .ui-dialog-content { + .ui-dialog-off-canvas .ui-dialog-content { -webkit-transition: all .7s ease; -moz-transition: all .7s ease; transition: all .7s ease; } } -.dialog-offcanvas__main-canvas { +.dialog-off-canvas__main-canvas { -webkit-transition: all .7s ease; -moz-transition: all .7s ease; transition: all .7s ease; diff --git a/core/modules/outside_in/css/outside_in.module.css b/core/modules/outside_in/css/outside_in.module.css index 5ac00ab42e50aa2f60a8f2de1cd12934be3fc4ca..9d90bf227d4517d2748e261e57102c4bbea01a41 100644 --- a/core/modules/outside_in/css/outside_in.module.css +++ b/core/modules/outside_in/css/outside_in.module.css @@ -27,7 +27,7 @@ * to expand dialog widths. */ @media all and (max-width: 48em) { /* 768px */ - .ui-dialog.ui-dialog-offcanvas { + .ui-dialog.ui-dialog-off-canvas { width: 100% !important; } /* When tray is at 100% width stop the body from scrolling */ diff --git a/core/modules/outside_in/css/outside_in.motion.css b/core/modules/outside_in/css/outside_in.motion.css index 450bffe77ba041ae2bb3bf6af35fa083d6810ecc..3c86aca36397648d2a1ff48b5cba2f5d825e034d 100644 --- a/core/modules/outside_in/css/outside_in.motion.css +++ b/core/modules/outside_in/css/outside_in.motion.css @@ -19,9 +19,9 @@ } /* Transition the editables on the page, their contextual links and their hover states. */ -.dialog-offcanvas__main-canvas .contextual, -.dialog-offcanvas__main-canvas .js-outside-in-edit-mode .outside-in-editable, -.dialog-offcanvas__main-canvas.js-tray-open .js-outside-in-edit-mode .outside-in-editable { +.dialog-off-canvas__main-canvas .contextual, +.dialog-off-canvas__main-canvas .js-outside-in-edit-mode .outside-in-editable, +.dialog-off-canvas__main-canvas.js-tray-open .js-outside-in-edit-mode .outside-in-editable { -webkit-transition: all .7s ease; -moz-transition: all .7s ease; transition: all .7s ease; diff --git a/core/modules/outside_in/css/outside_in.theme.css b/core/modules/outside_in/css/outside_in.theme.css index 91c01abfd8c066fb3f2a6d72f71e06f1c78506b1..011d198daed209e0d449c54ad3222934f04c98e5 100644 --- a/core/modules/outside_in/css/outside_in.theme.css +++ b/core/modules/outside_in/css/outside_in.theme.css @@ -60,16 +60,16 @@ } /* Style the editables while in edit mode. */ -.dialog-offcanvas__main-canvas.js-outside-in-edit-mode .outside-in-editable { +.dialog-off-canvas__main-canvas.js-outside-in-edit-mode .outside-in-editable { outline: 1px dashed rgba(0,0,0,0.5); box-shadow: 0 0 0 1px rgba(255,255,255,0.7); } -.dialog-offcanvas__main-canvas.js-outside-in-edit-mode .outside-in-editable:hover, -.dialog-offcanvas__main-canvas.js-outside-in-edit-mode .outside-in-editable.outside-in-active-editable { +.dialog-off-canvas__main-canvas.js-outside-in-edit-mode .outside-in-editable:hover, +.dialog-off-canvas__main-canvas.js-outside-in-edit-mode .outside-in-editable.outside-in-active-editable { background-color: rgba(0,0,0,0.2); } -/* Style the dialog-offcanvas container. */ +/* Style the dialog-off-canvas container. */ .ui-dialog-outside-in { background: #444; border: 0 solid transparent; diff --git a/core/modules/outside_in/js/offcanvas.js b/core/modules/outside_in/js/off-canvas.js similarity index 77% rename from core/modules/outside_in/js/offcanvas.js rename to core/modules/outside_in/js/off-canvas.js index 74cd32c964390ab46285b7fac44cca25d10e6aba..d7c8d906f6ba21a4d93978e2ecf1808971a25d38 100644 --- a/core/modules/outside_in/js/offcanvas.js +++ b/core/modules/outside_in/js/off-canvas.js @@ -22,7 +22,7 @@ */ var edge = document.documentElement.dir === 'rtl' ? 'left' : 'right'; - var $mainCanvasWrapper = $('[data-offcanvas-main-canvas]'); + var $mainCanvasWrapper = $('[data-off-canvas-main-canvas]'); /** * Resets the size of the dialog. @@ -51,7 +51,7 @@ $element .dialog('option', adjustedOptions) - .trigger('dialogContentResize.offcanvas'); + .trigger('dialogContentResize.off-canvas'); } /** @@ -64,7 +64,7 @@ var $element = event.data.$element; var $widget = $element.dialog('widget'); - var $offsets = $widget.find('> :not(#drupal-offcanvas, .ui-resizable-handle)'); + var $offsets = $widget.find('> :not(#drupal-off-canvas, .ui-resizable-handle)'); var offset = 0; var modalHeight; @@ -112,25 +112,25 @@ attach: function () { $(window).once('off-canvas').on({ 'dialog:aftercreate': function (event, dialog, $element, settings) { - if ($element.is('#drupal-offcanvas')) { + if ($element.is('#drupal-off-canvas')) { var eventData = {settings: settings, $element: $element}; - $('.ui-dialog-offcanvas, .ui-dialog-offcanvas .ui-dialog-titlebar').toggleClass('ui-dialog-empty-title', !settings.title); + $('.ui-dialog-off-canvas, .ui-dialog-off-canvas .ui-dialog-titlebar').toggleClass('ui-dialog-empty-title', !settings.title); $element - .on('dialogresize.offcanvas', eventData, debounce(bodyPadding, 100)) - .on('dialogContentResize.offcanvas', eventData, handleDialogResize) - .on('dialogContentResize.offcanvas', eventData, debounce(bodyPadding, 100)) - .trigger('dialogresize.offcanvas'); + .on('dialogresize.off-canvas', eventData, debounce(bodyPadding, 100)) + .on('dialogContentResize.off-canvas', eventData, handleDialogResize) + .on('dialogContentResize.off-canvas', eventData, debounce(bodyPadding, 100)) + .trigger('dialogresize.off-canvas'); $element.dialog('widget').attr('data-offset-' + edge, ''); $(window) - .on('resize.offcanvas scroll.offcanvas', eventData, debounce(resetSize, 100)) - .trigger('resize.offcanvas'); + .on('resize.off-canvas scroll.off-canvas', eventData, debounce(resetSize, 100)) + .trigger('resize.off-canvas'); } }, 'dialog:beforecreate': function (event, dialog, $element, settings) { - if ($element.is('#drupal-offcanvas')) { + if ($element.is('#drupal-off-canvas')) { $('body').addClass('js-tray-open'); // @see http://api.jqueryui.com/position/ settings.position = { @@ -138,18 +138,18 @@ at: edge + ' top', of: window }; - settings.dialogClass += ' ui-dialog-offcanvas'; + settings.dialogClass += ' ui-dialog-off-canvas'; // Applies initial height to dialog based on window height. // See http://api.jqueryui.com/dialog for all dialog options. settings.height = $(window).height(); } }, 'dialog:beforeclose': function (event, dialog, $element) { - if ($element.is('#drupal-offcanvas')) { + if ($element.is('#drupal-off-canvas')) { $('body').removeClass('js-tray-open'); - // Remove all *.offcanvas events - $(document).off('.offcanvas'); - $(window).off('.offcanvas'); + // Remove all *.off-canvas events + $(document).off('.off-canvas'); + $(window).off('.off-canvas'); $mainCanvasWrapper.css('padding-' + edge, 0); } } diff --git a/core/modules/outside_in/js/outside_in.js b/core/modules/outside_in/js/outside_in.js index c038cd21d08426c5ac0d79f9afb4b35a5a6e22a1..b4bca7d0180eab8caef8f2a943278ebcd8ee5b94 100644 --- a/core/modules/outside_in/js/outside_in.js +++ b/core/modules/outside_in/js/outside_in.js @@ -9,7 +9,7 @@ var blockConfigureSelector = '[data-outside-in-edit]'; var toggleEditSelector = '[data-drupal-outsidein="toggle"]'; - var itemsToToggleSelector = '[data-offcanvas-main-canvas], #toolbar-bar, [data-drupal-outsidein="editable"] a, [data-drupal-outsidein="editable"] button'; + var itemsToToggleSelector = '[data-off-canvas-main-canvas], #toolbar-bar, [data-drupal-outsidein="editable"] a, [data-drupal-outsidein="editable"] button'; var contextualItemsSelector = '[data-contextual-id] a, [data-contextual-id] button'; var quickEditItemSelector = '[data-quickedit-entity-id]'; @@ -111,10 +111,10 @@ } /** - * Closes/removes offcanvas. + * Closes/removes off-canvas. */ function closeOffCanvas() { - $('.ui-dialog-offcanvas .ui-dialog-titlebar-close').trigger('click'); + $('.ui-dialog-off-canvas .ui-dialog-titlebar-close').trigger('click'); } /** @@ -135,7 +135,7 @@ $editables = $('[data-drupal-outsidein="editable"]').once('outsidein'); if ($editables.length) { // Use event capture to prevent clicks on links. - document.querySelector('[data-offcanvas-main-canvas]').addEventListener('click', preventClick, true); + document.querySelector('[data-off-canvas-main-canvas]').addEventListener('click', preventClick, true); // When a click occurs try and find the outside-in edit link // and click it. @@ -152,7 +152,7 @@ $(quickEditItemSelector) .not(contextualItemsSelector) .on('click.outsidein', function (e) { - // For all non-contextual links or the contextual QuickEdit link close the off-canvas tray. + // For all non-contextual links or the contextual QuickEdit link close the off-canvas dialog. if (!$(e.target).parent().hasClass('contextual') || $(e.target).parent().hasClass('quickedit')) { closeOffCanvas(); } @@ -168,7 +168,7 @@ else { $editables = $('[data-drupal-outsidein="editable"]').removeOnce('outsidein'); if ($editables.length) { - document.querySelector('[data-offcanvas-main-canvas]').removeEventListener('click', preventClick, true); + document.querySelector('[data-off-canvas-main-canvas]').removeEventListener('click', preventClick, true); $editables.off('.outsidein'); $(quickEditItemSelector).off('.outsidein'); } @@ -212,19 +212,19 @@ $(toggleEditSelector).once('outsidein').on('click.outsidein', toggleEditMode); var search = Drupal.ajax.WRAPPER_FORMAT + '=drupal_dialog'; - var replace = Drupal.ajax.WRAPPER_FORMAT + '=drupal_dialog_offcanvas'; - // Loop through all Ajax links and change the format to dialog-offcanvas when + var replace = Drupal.ajax.WRAPPER_FORMAT + '=drupal_dialog_off_canvas'; + // Loop through all Ajax links and change the format to dialog-off-canvas when // needed. Drupal.ajax.instances .filter(function (instance) { var hasElement = instance && !!instance.element; - var rendererOffcanvas = false; - var wrapperOffcanvas = false; + var rendererOffCanvas = false; + var wrapperOffCanvas = false; if (hasElement) { - rendererOffcanvas = $(instance.element).attr('data-dialog-renderer') === 'offcanvas'; - wrapperOffcanvas = instance.options.url.indexOf('drupal_dialog_offcanvas') === -1; + rendererOffCanvas = $(instance.element).attr('data-dialog-renderer') === 'off_canvas'; + wrapperOffCanvas = instance.options.url.indexOf('drupal_dialog_off_canvas') === -1; } - return hasElement && rendererOffcanvas && wrapperOffcanvas; + return hasElement && rendererOffCanvas && wrapperOffCanvas; }) .forEach(function (instance) { // @todo Move logic for data-dialog-renderer attribute into ajax.js @@ -243,7 +243,7 @@ // Manage Active editable class on opening and closing of the dialog. $(window).on({ 'dialog:beforecreate': function (event, dialog, $element, settings) { - if ($element.is('#drupal-offcanvas')) { + if ($element.is('#drupal-off-canvas')) { $('body .outside-in-active-editable').removeClass('outside-in-active-editable'); var $activeElement = $('#' + settings.outsideInActiveEditableId); if ($activeElement.length) { @@ -253,7 +253,7 @@ } }, 'dialog:beforeclose': function (event, dialog, $element) { - if ($element.is('#drupal-offcanvas')) { + if ($element.is('#drupal-off-canvas')) { $('body .outside-in-active-editable').removeClass('outside-in-active-editable'); } } diff --git a/core/modules/outside_in/outside_in.libraries.yml b/core/modules/outside_in/outside_in.libraries.yml index 5eddea4ca6ea1f3409bc5302855b94908aa50179..5c388b82f140842a92b0d4176b60f28e652eb7ce 100644 --- a/core/modules/outside_in/outside_in.libraries.yml +++ b/core/modules/outside_in/outside_in.libraries.yml @@ -23,7 +23,7 @@ drupal.outside_in: drupal.off_canvas: version: VERSION js: - js/offcanvas.js: {} + js/off-canvas.js: {} dependencies: - core/jquery - core/drupal diff --git a/core/modules/outside_in/outside_in.links.contextual.yml b/core/modules/outside_in/outside_in.links.contextual.yml index 99b36eff00c376ac314a6189047de8f7bcda861b..b0c0f13d1ef95030710b5c75d847c3f7c563b16a 100644 --- a/core/modules/outside_in/outside_in.links.contextual.yml +++ b/core/modules/outside_in/outside_in.links.contextual.yml @@ -1,4 +1,4 @@ outside_in.block_configure: title: 'Quick edit' - route_name: 'entity.block.offcanvas_form' + route_name: 'entity.block.off_canvas_form' group: 'block' diff --git a/core/modules/outside_in/outside_in.module b/core/modules/outside_in/outside_in.module index 9a0e629465003045c3129ad8ac5e60f2feb81275..6673fa37185c100c85c2a2ab0ea3259f330fd329 100644 --- a/core/modules/outside_in/outside_in.module +++ b/core/modules/outside_in/outside_in.module @@ -30,7 +30,7 @@ function outside_in_help($route_name, RouteMatchInterface $route_match) { /** * Implements hook_contextual_links_view_alter(). * - * Change Configure Blocks into offcanvas links. + * Change Configure Blocks into off_canvas links. */ function outside_in_contextual_links_view_alter(&$element, $items) { if (isset($element['#links']['outside-inblock-configure'])) { @@ -42,7 +42,7 @@ function outside_in_contextual_links_view_alter(&$element, $items) { $element['#links']['outside-inblock-configure']['attributes'] = [ 'class' => ['use-ajax'], 'data-dialog-type' => 'dialog', - 'data-dialog-renderer' => 'offcanvas', + 'data-dialog-renderer' => 'off_canvas', 'data-outside-in-edit' => TRUE, ]; // If this is content block change title to avoid duplicate "Quick Edit". @@ -92,8 +92,8 @@ function outside_in_theme() { function outside_in_entity_type_build(array &$entity_types) { /* @var $entity_types \Drupal\Core\Entity\EntityTypeInterface[] */ $entity_types['block'] - ->setFormClass('offcanvas', BlockEntityOffCanvasForm::class) - ->setLinkTemplate('offcanvas-form', '/admin/structure/block/manage/{block}/offcanvas'); + ->setFormClass('off_canvas', BlockEntityOffCanvasForm::class) + ->setLinkTemplate('off_canvas-form', '/admin/structure/block/manage/{block}/off-canvas'); } /** @@ -139,14 +139,14 @@ function outside_in_toolbar_alter(&$items) { */ function outside_in_block_alter(&$definitions) { if (!empty($definitions['system_branding_block'])) { - $definitions['system_branding_block']['forms']['offcanvas'] = SystemBrandingOffCanvasForm::class; + $definitions['system_branding_block']['forms']['off_canvas'] = SystemBrandingOffCanvasForm::class; } // Since menu blocks use derivatives, check the definition ID instead of // relying on the plugin ID. foreach ($definitions as &$definition) { if ($definition['id'] === 'system_menu_block') { - $definition['forms']['offcanvas'] = SystemMenuOffCanvasForm::class; + $definition['forms']['off_canvas'] = SystemMenuOffCanvasForm::class; } } } diff --git a/core/modules/outside_in/outside_in.routing.yml b/core/modules/outside_in/outside_in.routing.yml index 79bc38d90b6cd2d6d1205c893d883ab6e0f46c90..18a564c304815cda799b6c1c54b2b79593a8e934 100644 --- a/core/modules/outside_in/outside_in.routing.yml +++ b/core/modules/outside_in/outside_in.routing.yml @@ -1,7 +1,7 @@ -entity.block.offcanvas_form: - path: '/admin/structure/block/manage/{block}/offcanvas' +entity.block.off_canvas_form: + path: '/admin/structure/block/manage/{block}/off-canvas' defaults: - _entity_form: 'block.offcanvas' + _entity_form: 'block.off_canvas' _title_callback: '\Drupal\outside_in\Block\BlockEntityOffCanvasForm::title' requirements: _permission: 'administer blocks' diff --git a/core/modules/outside_in/outside_in.services.yml b/core/modules/outside_in/outside_in.services.yml index 48f58242f9d75896ea8b7299564b26d7f7e72bf7..37ba1b351a3694b6f86ef07be14db98a77efa071 100644 --- a/core/modules/outside_in/outside_in.services.yml +++ b/core/modules/outside_in/outside_in.services.yml @@ -3,7 +3,7 @@ services: class: Drupal\outside_in\Render\MainContent\OffCanvasRender arguments: ['@title_resolver', '@renderer'] tags: - - { name: render.main_content_renderer, format: drupal_dialog_offcanvas } + - { name: render.main_content_renderer, format: drupal_dialog_off_canvas } outside_in.manager: class: Drupal\outside_in\OutsideInManager diff --git a/core/modules/outside_in/src/Ajax/OpenOffCanvasDialogCommand.php b/core/modules/outside_in/src/Ajax/OpenOffCanvasDialogCommand.php index d78dc3539e21b824fb18ab221547ce71aeefa10b..9989d91f652745abb9cd4f84d3776d82c0feadb0 100644 --- a/core/modules/outside_in/src/Ajax/OpenOffCanvasDialogCommand.php +++ b/core/modules/outside_in/src/Ajax/OpenOffCanvasDialogCommand.php @@ -5,7 +5,7 @@ use Drupal\Core\Ajax\OpenDialogCommand; /** - * Defines an AJAX command to open content in a dialog in a off-canvas tray. + * Defines an AJAX command to open content in a dialog in a off-canvas dialog. * * @ingroup ajax */ @@ -16,7 +16,7 @@ class OpenOffCanvasDialogCommand extends OpenDialogCommand { * * The off-canvas dialog differs from the normal modal provided by * OpenDialogCommand in that a off-canvas has built in positioning and - * behaviours. Drupal provides a built-in off-canvas tray for this purpose, + * behaviours. Drupal provides a built-in off-canvas dialog for this purpose, * so the selector is hard-coded in the call to the parent constructor. * * @param string $title @@ -33,7 +33,7 @@ class OpenOffCanvasDialogCommand extends OpenDialogCommand { * populated automatically from the current request. */ public function __construct($title, $content, array $dialog_options = [], $settings = NULL) { - parent::__construct('#drupal-offcanvas', $title, $content, $dialog_options, $settings); + parent::__construct('#drupal-off-canvas', $title, $content, $dialog_options, $settings); $this->dialogOptions['modal'] = FALSE; $this->dialogOptions['autoResize'] = FALSE; $this->dialogOptions['resizable'] = 'w'; diff --git a/core/modules/outside_in/src/Block/BlockEntityOffCanvasForm.php b/core/modules/outside_in/src/Block/BlockEntityOffCanvasForm.php index a77f51fca8e86c424cfb0f1dbfa2002a9a491bcb..4e0f081fb5c840a14560cbcac263131b79f2e19d 100644 --- a/core/modules/outside_in/src/Block/BlockEntityOffCanvasForm.php +++ b/core/modules/outside_in/src/Block/BlockEntityOffCanvasForm.php @@ -9,7 +9,7 @@ use Drupal\Core\Plugin\PluginWithFormsInterface; /** - * Provides form for block instance forms when used in the off-canvas tray. + * Provides form for block instance forms when used in the off-canvas dialog. * * This form removes advanced sections of regular block form such as the * visibility settings, machine ID and region. @@ -92,7 +92,7 @@ protected function submitVisibility(array $form, FormStateInterface $form_state) */ protected function getPluginForm(BlockPluginInterface $block) { if ($block instanceof PluginWithFormsInterface) { - return $this->pluginFormFactory->createInstance($block, 'offcanvas', 'configure'); + return $this->pluginFormFactory->createInstance($block, 'off_canvas', 'configure'); } return $block; } diff --git a/core/modules/outside_in/src/Render/MainContent/OffCanvasRender.php b/core/modules/outside_in/src/Render/MainContent/OffCanvasRender.php index 5d24c09a7990c885f3e738ac1ad62814209a4db3..9119c9b8cf3d832b2738b8363d3366fff1a70eb8 100644 --- a/core/modules/outside_in/src/Render/MainContent/OffCanvasRender.php +++ b/core/modules/outside_in/src/Render/MainContent/OffCanvasRender.php @@ -11,7 +11,7 @@ use Symfony\Component\HttpFoundation\Request; /** - * Default main content renderer for offcanvas dialog requests. + * Default main content renderer for off-canvas dialog requests. */ class OffCanvasRender extends DialogRenderer { @@ -43,7 +43,6 @@ public function renderResponse(array $main_content, Request $request, RouteMatch // First render the main content, because it might provide a title. $content = $this->renderer->renderRoot($main_content); - // Attach the library necessary for using the OpenOffCanvasDialogCommand and // set the attachments for this Ajax response. $main_content['#attached']['library'][] = 'outside_in/drupal.off_canvas'; @@ -55,7 +54,6 @@ public function renderResponse(array $main_content, Request $request, RouteMatch // Determine the title: use the title provided by the main content if any, // otherwise get it from the routing information. $options = $request->request->get('dialogOptions', []); - $response->addCommand(new OpenOffCanvasDialogCommand($title, $content, $options)); return $response; } diff --git a/core/modules/outside_in/src/Tests/Ajax/OffCanvasDialogTest.php b/core/modules/outside_in/src/Tests/Ajax/OffCanvasDialogTest.php index f3510427bd100be12652243bac5b00e201d5a5f8..41d66dde3f00a3b4faa9e8725d38f8bace976674 100644 --- a/core/modules/outside_in/src/Tests/Ajax/OffCanvasDialogTest.php +++ b/core/modules/outside_in/src/Tests/Ajax/OffCanvasDialogTest.php @@ -21,7 +21,7 @@ class OffCanvasDialogTest extends AjaxTestBase { public static $modules = ['outside_in']; /** - * Test sending AJAX requests to open and manipulate offcanvas dialog. + * Test sending AJAX requests to open and manipulate off-canvas dialog. */ public function testDialog() { $this->drupalLogin($this->drupalCreateUser(['administer contact forms'])); @@ -32,9 +32,9 @@ public function testDialog() { $dialog_renderable = AjaxTestController::dialogContents(); $dialog_contents = \Drupal::service('renderer')->renderRoot($dialog_renderable); - $offcanvas_expected_response = [ + $off_canvas_expected_response = [ 'command' => 'openDialog', - 'selector' => '#drupal-offcanvas', + 'selector' => '#drupal-off-canvas', 'settings' => NULL, 'data' => $dialog_contents, 'dialogOptions' => @@ -52,8 +52,8 @@ public function testDialog() { ]; // Emulate going to the JS version of the page and check the JSON response. - $ajax_result = $this->drupalGetAjax('ajax-test/dialog-contents', ['query' => [MainContentViewSubscriber::WRAPPER_FORMAT => 'drupal_dialog_offcanvas']]); - $this->assertEqual($offcanvas_expected_response, $ajax_result[3], 'Off-canvas dialog JSON response matches.'); + $ajax_result = $this->drupalGetAjax('ajax-test/dialog-contents', ['query' => [MainContentViewSubscriber::WRAPPER_FORMAT => 'drupal_dialog_off_canvas']]); + $this->assertEqual($off_canvas_expected_response, $ajax_result[3], 'off-canvas dialog JSON response matches.'); } } diff --git a/core/modules/outside_in/templates/outside-in-page-wrapper.html.twig b/core/modules/outside_in/templates/outside-in-page-wrapper.html.twig index adedc6bb341e90b267383bf33a509d728d74a146..c2f5fb9a3f320f90e049c44d9076b18ee9aa5f7a 100644 --- a/core/modules/outside_in/templates/outside-in-page-wrapper.html.twig +++ b/core/modules/outside_in/templates/outside-in-page-wrapper.html.twig @@ -12,7 +12,7 @@ */ #} {% if children %} -
Text!
', 'dialogOptions' => [