mirror of
https://github.com/google/blockly.git
synced 2026-01-27 18:50:09 +01:00
Fix dropdowns on scrolled pages. Issue 183.
This commit is contained in:
@@ -174,7 +174,7 @@ Blockly.FieldDropdown.prototype.showEditor_ = function() {
|
||||
// Flip menu vertically if off the bottom.
|
||||
if (xy.y + menuSize.height + borderBBox.height >=
|
||||
windowSize.height + scrollOffset.y) {
|
||||
xy.y -= menuSize.height;
|
||||
xy.y -= menuSize.height + 2;
|
||||
} else {
|
||||
xy.y += borderBBox.height;
|
||||
}
|
||||
|
||||
@@ -87,6 +87,7 @@ Blockly.WidgetDiv.hide = function() {
|
||||
Blockly.WidgetDiv.DIV.style.display = 'none';
|
||||
Blockly.WidgetDiv.DIV.style.left = '';
|
||||
Blockly.WidgetDiv.DIV.style.top = '';
|
||||
Blockly.WidgetDiv.DIV.style.height = '';
|
||||
Blockly.WidgetDiv.dispose_ && Blockly.WidgetDiv.dispose_();
|
||||
Blockly.WidgetDiv.owner_ = null;
|
||||
Blockly.WidgetDiv.dispose_ = null;
|
||||
@@ -129,7 +130,7 @@ Blockly.WidgetDiv.position = function(anchorX, anchorY, windowSize,
|
||||
anchorY = scrollOffset.y;
|
||||
}
|
||||
if (rtl) {
|
||||
// Don't let the menu go right of the right edge of the window.
|
||||
// Don't let the widget go right of the right edge of the window.
|
||||
if (anchorX > windowSize.width + scrollOffset.x) {
|
||||
anchorX = windowSize.width + scrollOffset.x;
|
||||
}
|
||||
@@ -141,5 +142,6 @@ Blockly.WidgetDiv.position = function(anchorX, anchorY, windowSize,
|
||||
}
|
||||
Blockly.WidgetDiv.DIV.style.left = anchorX + 'px';
|
||||
Blockly.WidgetDiv.DIV.style.top = anchorY + 'px';
|
||||
Blockly.WidgetDiv.DIV.style.height = windowSize.height - anchorY + 'px';
|
||||
Blockly.WidgetDiv.DIV.style.height =
|
||||
(windowSize.height - anchorY + scrollOffset.y) + 'px';
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user