mirror of
https://github.com/scratchfoundation/scratch-blocks.git
synced 2025-08-28 22:10:31 -04:00
Position toolbox correctly at bottom
This commit is contained in:
parent
cb1188af45
commit
e596e23012
2 changed files with 3 additions and 5 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue