diff --git a/core/modules/workspace/css/workspace.toolbar.css b/core/modules/workspace/css/workspace.toolbar.css index 549ccef..7fb58a9 100644 --- a/core/modules/workspace/css/workspace.toolbar.css +++ b/core/modules/workspace/css/workspace.toolbar.css @@ -218,27 +218,26 @@ div.workspace-dialog #drupal-off-canvas .active-workspace label:before { top: 1.5em; } - body.workspace-dialog-open { + body.js-off-canvas-dialog-open { background-color: #444444; padding-left: 40px; padding-right: 40px; } - body.path-admin.workspace-dialog-open { + body.path-admin.js-off-canvas-dialog-open { background-color: #444444; } - body.workspace-dialog-open #toolbar-bar { + body.js-off-canvas-dialog-open #toolbar-bar { margin-left: 40px; margin-right: 40px; - margin-top: 274px !important; } .dialog-off-canvas-main-canvas { background-color: #ffffff; } - .workspace-dialog-open .toolbar-oriented .toolbar-tray-vertical.is-active { + .js-off-canvas-dialog-open .toolbar-oriented .toolbar-tray-vertical.is-active { left: 39px; } } \ No newline at end of file diff --git a/core/modules/workspace/js/workspace.toolbar.js b/core/modules/workspace/js/workspace.toolbar.js deleted file mode 100644 index 8ce5c83..0000000 --- a/core/modules/workspace/js/workspace.toolbar.js +++ /dev/null @@ -1,13 +0,0 @@ -(function ($) { - $(document).ready(function() { - $(window).on('dialog:aftercreate', (e, dialog, $element) => { - if ($(".workspace-dialog")[0]){ - $('body').toggleClass('workspace-dialog-open'); - } - }); - - $(window).on('dialog:beforeclose', (e, dialog, $element) => { - $('body').removeClass('workspace-dialog-open'); - }); - }); -})(jQuery); \ No newline at end of file diff --git a/core/modules/workspace/workspace.libraries.yml b/core/modules/workspace/workspace.libraries.yml index cc20a36..c7aad42 100644 --- a/core/modules/workspace/workspace.libraries.yml +++ b/core/modules/workspace/workspace.libraries.yml @@ -3,5 +3,3 @@ drupal.workspace.toolbar: css: theme: css/workspace.toolbar.css: {} - js: - js/workspace.toolbar.js: {} diff --git a/core/modules/workspace/workspace.module b/core/modules/workspace/workspace.module index 9ec35c2..a2000e0 100644 --- a/core/modules/workspace/workspace.module +++ b/core/modules/workspace/workspace.module @@ -5,6 +5,7 @@ * Provides full-site preview functionality for content staging. */ +use Drupal\Component\Serialization\Json; use Drupal\Core\Entity\EntityInterface; use Drupal\Core\Form\FormStateInterface; use Drupal\Core\Routing\RouteMatchInterface; @@ -156,9 +157,11 @@ function workspace_toolbar() { 'class' => ['use-ajax', 'toolbar-icon', 'toolbar-icon-workspace'], 'data-dialog-type' => 'dialog', 'data-dialog-renderer' => 'off_canvas_top', - 'data-dialog-options' => json_encode([ + 'data-dialog-options' => Json::encode([ 'height' => 234, - 'classes' => ['ui-dialog' => 'workspace-dialog'], + 'classes' => [ + 'ui-dialog' => 'workspace-dialog', + ], ]), ], ],