Commit 845b1c6c authored by Cottser's avatar Cottser

Issue #2902361 by drpal: [regression] In Settings Tray when the form is longer...

Issue #2902361 by drpal: [regression] In Settings Tray when the form is longer than the page body it is tricky to scroll to the very bottom
parent 7b7779f6
......@@ -155,6 +155,7 @@
const offsets = displace.offsets;
const $element = event.data.$element;
const container = Drupal.offCanvas.getContainer($element);
const $elementScroll = $element.scrollTop();
const topPosition = (offsets.top !== 0 ? `+${offsets.top}` : '');
const adjustedOptions = {
......@@ -174,6 +175,9 @@
$element
.dialog('option', adjustedOptions)
.trigger('dialogContentResize.off-canvas');
// Reset the elements scroll position after being repositioned.
$element.scrollTop($elementScroll);
},
/**
......
......@@ -73,6 +73,7 @@
var offsets = displace.offsets;
var $element = event.data.$element;
var container = Drupal.offCanvas.getContainer($element);
var $elementScroll = $element.scrollTop();
var topPosition = offsets.top !== 0 ? '+' + offsets.top : '';
var adjustedOptions = {
......@@ -89,6 +90,8 @@
});
$element.dialog('option', adjustedOptions).trigger('dialogContentResize.off-canvas');
$element.scrollTop($elementScroll);
},
bodyPadding: function bodyPadding(event) {
if ($('body').outerWidth() < Drupal.offCanvas.minDisplaceWidth) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment