Updated Drupal to 8.6. This goes with the following updates because it's possible...
[yaffs-website] / web / core / modules / toolbar / js / toolbar.js
index 7246420f8888ddc6cbe7407f1b39a890629d3bc2..f705a9b0153cb2ea22b7e9a3b729e895ffc18e97 100644 (file)
             activeTab: $('.toolbar-bar .toolbar-tab:not(.home-toolbar-tab) a').get(0)
           });
         }
+
+        $(window).on({
+          'dialog:aftercreate': function dialogAftercreate(event, dialog, $element, settings) {
+            var $toolbar = $('#toolbar-bar');
+            $toolbar.css('margin-top', '0');
+
+            if (settings.drupalOffCanvasPosition === 'top') {
+              var height = Drupal.offCanvas.getContainer($element).outerHeight();
+              $toolbar.css('margin-top', height + 'px');
+
+              $element.on('dialogContentResize.off-canvas', function () {
+                var newHeight = Drupal.offCanvas.getContainer($element).outerHeight();
+                $toolbar.css('margin-top', newHeight + 'px');
+              });
+            }
+          },
+          'dialog:beforeclose': function dialogBeforeclose() {
+            $('#toolbar-bar').css('margin-top', '0');
+          }
+        });
       });
     }
   };