mirror of
https://github.com/google/blockly.git
synced 2026-01-07 00:50:27 +01:00
Merge pull request #2180 from epicfaace/feature/scroll
Scroll very long context menus
This commit is contained in:
@@ -584,6 +584,7 @@ Blockly.Css.CONTENT = [
|
||||
|
||||
'.blocklyContextMenu {',
|
||||
'border-radius: 4px;',
|
||||
'max-height: 100%;',
|
||||
'}',
|
||||
|
||||
'.blocklyDropdownMenu {',
|
||||
|
||||
@@ -186,7 +186,12 @@ Blockly.WidgetDiv.positionWithAnchor = function(viewportBBox, anchorBBox,
|
||||
var x = Blockly.WidgetDiv.calculateX_(viewportBBox, anchorBBox, widgetSize,
|
||||
rtl);
|
||||
|
||||
Blockly.WidgetDiv.positionInternal_(x, y, widgetSize.height);
|
||||
if (y < 0) {
|
||||
Blockly.WidgetDiv.positionInternal_(x, 0, widgetSize.height + y);
|
||||
}
|
||||
else {
|
||||
Blockly.WidgetDiv.positionInternal_(x, y, widgetSize.height);
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user