mirror of
https://github.com/google/blockly.git
synced 2026-01-09 18:10:08 +01:00
Position toolbox correctly at bottom
This commit is contained in:
@@ -415,10 +415,8 @@ Blockly.hideChaff = function(opt_allowToolbox) {
|
||||
Blockly.getMainWorkspaceMetrics_ = function() {
|
||||
var svgSize = Blockly.svgSize(this.getParentSvg());
|
||||
if (this.toolbox_) {
|
||||
// If the toolbox is at the bottom it's laid out separately from the main
|
||||
// workspace, rather than overlapping, so we don't need to take its size
|
||||
// into account.
|
||||
if (this.toolboxPosition == Blockly.TOOLBOX_AT_TOP) {
|
||||
if (this.toolboxPosition == Blockly.TOOLBOX_AT_TOP ||
|
||||
this.toolboxPosition == Blockly.TOOLBOX_AT_BOTTOM) {
|
||||
svgSize.height -= this.toolbox_.getHeight();
|
||||
} else if (this.toolboxPosition == Blockly.TOOLBOX_AT_LEFT ||
|
||||
this.toolboxPosition == Blockly.TOOLBOX_AT_RIGHT) {
|
||||
|
||||
@@ -238,7 +238,7 @@ Blockly.Toolbox.prototype.position = function() {
|
||||
if (this.toolboxPosition == Blockly.TOOLBOX_AT_TOP) { // Top
|
||||
treeDiv.style.top = svgPosition.y + 'px';
|
||||
} else { // Bottom
|
||||
var topOfToolbox = svgPosition.y + svgSize.height;
|
||||
var topOfToolbox = svgPosition.y + svgSize.height - treeDiv.offsetHeight;
|
||||
treeDiv.style.top = topOfToolbox + 'px';
|
||||
}
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user