Made the changes asked by the reviewer

This commit is contained in:
Sandeep Dubey
2017-12-03 02:40:11 +05:30
parent 762e8d9c38
commit 2dd8c1f669
2 changed files with 13 additions and 0 deletions

View File

@@ -499,6 +499,9 @@ Blockly.Css.CONTENT = [
'.blocklyDropdownMenu {',
'padding: 0 !important;',
/* max-height value is same as the constant
* Blockly.FieldDropdown.MAX_MENU_HEIGHT defined in field_dropdown.js. */
'max-height: 300px !important;',
'}',
/* Override the default Closure URL. */

View File

@@ -68,6 +68,12 @@ goog.inherits(Blockly.FieldDropdown, Blockly.Field);
*/
Blockly.FieldDropdown.CHECKMARK_OVERHANG = 25;
/**
* Maximum height of the dropdown menu,it's also referenced in css.js as
* part of .blocklyDropdownMenu.
*/
Blockly.FieldDropdown.MAX_MENU_HEIGHT = 300;
/**
* Android can't (in 2014) display "▾", so use "▼" instead.
*/
@@ -239,6 +245,10 @@ Blockly.FieldDropdown.prototype.positionMenu_ = function(menu) {
this.createWidget_(menu);
var menuSize = Blockly.utils.uiMenu.getSize(menu);
if (menuSize.height > Blockly.FieldDropdown.MAX_MENU_HEIGHT) {
menuSize.height = Blockly.FieldDropdown.MAX_MENU_HEIGHT;
}
if (this.sourceBlock_.RTL) {
Blockly.utils.uiMenu.adjustBBoxesForRTL(viewportBBox, anchorBBox, menuSize);
}