mirror of
https://github.com/google/blockly.git
synced 2026-01-08 01:20:12 +01:00
Fix flyouts (#3645)
* Set toolboxPosition after options have been parsed * Final toolbox position update
This commit is contained in:
@@ -170,11 +170,11 @@ Blockly.Mutator.prototype.createEditor_ = function() {
|
|||||||
'parentWorkspace': this.block_.workspace,
|
'parentWorkspace': this.block_.workspace,
|
||||||
'media': this.block_.workspace.options.pathToMedia,
|
'media': this.block_.workspace.options.pathToMedia,
|
||||||
'rtl': this.block_.RTL,
|
'rtl': this.block_.RTL,
|
||||||
'toolboxPosition': this.block_.RTL ? Blockly.TOOLBOX_AT_RIGHT :
|
|
||||||
Blockly.TOOLBOX_AT_LEFT,
|
|
||||||
'horizontalLayout': false,
|
'horizontalLayout': false,
|
||||||
'renderer': this.block_.workspace.options.renderer
|
'renderer': this.block_.workspace.options.renderer
|
||||||
}));
|
}));
|
||||||
|
workspaceOptions.toolboxPosition = this.block_.RTL ? Blockly.TOOLBOX_AT_RIGHT :
|
||||||
|
Blockly.TOOLBOX_AT_LEFT;
|
||||||
workspaceOptions.languageTree = quarkXml;
|
workspaceOptions.languageTree = quarkXml;
|
||||||
workspaceOptions.getMetrics = this.getFlyoutMetrics_.bind(this);
|
workspaceOptions.getMetrics = this.getFlyoutMetrics_.bind(this);
|
||||||
this.workspace_ = new Blockly.WorkspaceSvg(workspaceOptions);
|
this.workspace_ = new Blockly.WorkspaceSvg(workspaceOptions);
|
||||||
|
|||||||
@@ -186,9 +186,9 @@ Blockly.Toolbox.prototype.init = function() {
|
|||||||
'rtl': workspace.RTL,
|
'rtl': workspace.RTL,
|
||||||
'oneBasedIndex': workspace.options.oneBasedIndex,
|
'oneBasedIndex': workspace.options.oneBasedIndex,
|
||||||
'horizontalLayout': workspace.horizontalLayout,
|
'horizontalLayout': workspace.horizontalLayout,
|
||||||
'toolboxPosition': workspace.options.toolboxPosition,
|
|
||||||
'renderer': workspace.options.renderer
|
'renderer': workspace.options.renderer
|
||||||
}));
|
}));
|
||||||
|
workspaceOptions.toolboxPosition = workspace.options.toolboxPosition;
|
||||||
|
|
||||||
if (workspace.horizontalLayout) {
|
if (workspace.horizontalLayout) {
|
||||||
if (!Blockly.HorizontalFlyout) {
|
if (!Blockly.HorizontalFlyout) {
|
||||||
|
|||||||
@@ -899,9 +899,9 @@ Blockly.WorkspaceSvg.prototype.addFlyout = function(tagName) {
|
|||||||
'rtl': this.RTL,
|
'rtl': this.RTL,
|
||||||
'oneBasedIndex': this.options.oneBasedIndex,
|
'oneBasedIndex': this.options.oneBasedIndex,
|
||||||
'horizontalLayout': this.horizontalLayout,
|
'horizontalLayout': this.horizontalLayout,
|
||||||
'toolboxPosition': this.options.toolboxPosition,
|
|
||||||
'renderer': this.options.renderer
|
'renderer': this.options.renderer
|
||||||
}));
|
}));
|
||||||
|
workspaceOptions.toolboxPosition = this.options.toolboxPosition;
|
||||||
if (this.horizontalLayout) {
|
if (this.horizontalLayout) {
|
||||||
if (!Blockly.HorizontalFlyout) {
|
if (!Blockly.HorizontalFlyout) {
|
||||||
throw Error('Missing require for Blockly.HorizontalFlyout');
|
throw Error('Missing require for Blockly.HorizontalFlyout');
|
||||||
|
|||||||
Reference in New Issue
Block a user