mirror of
https://github.com/google/blockly.git
synced 2026-01-09 10:00:09 +01:00
Merge pull request #131 from carlosperate/menu_height
Contain the height of the field dropdown to the window viewport height.
This commit is contained in:
@@ -547,6 +547,9 @@ Blockly.Css.CONTENT = [
|
||||
' outline: none;',
|
||||
' padding: 4px 0;',
|
||||
' position: absolute;',
|
||||
' overflow-y: auto;',
|
||||
' overflow-x: hidden;',
|
||||
' max-height: 100%;',
|
||||
' z-index: 20000;', /* Arbitrary, but some apps depend on it... */
|
||||
'}',
|
||||
|
||||
|
||||
@@ -165,6 +165,8 @@ Blockly.FieldDropdown.prototype.showEditor_ = function() {
|
||||
Blockly.addClass_(menuDom, 'blocklyDropdownMenu');
|
||||
// Record menuSize after adding menu.
|
||||
var menuSize = goog.style.getSize(menuDom);
|
||||
// Recalculate height for the total content, not only box height.
|
||||
menuSize.height = menuDom.scrollHeight;
|
||||
|
||||
// Position the menu.
|
||||
// Flip menu vertically if off the bottom.
|
||||
|
||||
@@ -139,4 +139,5 @@ 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';
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user