Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Turn toolbox sideways in the horizontal playground. #57

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Turn toolbox sideways in the horizontal playground.
  • Loading branch information
rachel-fenichel committed Feb 11, 2016
commit 803d0e72b2e894aa775fd0b916527095214c0b78
2 changes: 1 addition & 1 deletion core/flyout.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ Blockly.Flyout = function(workspaceOptions) {
* Flyout should be laid out horizontally vs vertically.
* @type {boolean}
*/
this.horizontalLayout_ = false;
this.horizontalLayout_ = workspaceOptions.horizontalLayout;

/**
* Opaque data that can be passed to Blockly.unbindEvent_.
Expand Down
5 changes: 5 additions & 0 deletions core/inject.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,10 @@ Blockly.parseOptions_ = function(options) {
if (hasSounds === undefined) {
hasSounds = true;
}
var horizontalLayout = options['horizontalLayout'];
if (horizontalLayout === undefined) {
horizontalLayout = false;
}
}
var hasScrollbars = options['scrollbars'];
if (hasScrollbars === undefined) {
Expand Down Expand Up @@ -201,6 +205,7 @@ Blockly.parseOptions_ = function(options) {
hasTrashcan: hasTrashcan,
hasSounds: hasSounds,
hasCss: hasCss,
horizontalLayout: horizontalLayout,
languageTree: languageTree,
gridOptions: gridOptions,
zoomOptions: zoomOptions,
Expand Down
5 changes: 3 additions & 2 deletions core/toolbox.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ Blockly.Toolbox = function(workspace) {
* @type {boolean}
* @private
*/
this.horizontalLayout_ = false;
this.horizontalLayout_ = workspace.options.horizontalLayout;

if (this.horizontalLayout_) {
this.CONFIG_['cssTreeRow'] =
Expand Down Expand Up @@ -148,7 +148,8 @@ Blockly.Toolbox.prototype.init = function() {
var workspaceOptions = {
disabledPatternId: workspace.options.disabledPatternId,
parentWorkspace: workspace,
RTL: workspace.RTL
RTL: workspace.RTL,
horizontalLayout: workspace.horizontalLayout
};

/**
Expand Down
2 changes: 2 additions & 0 deletions core/workspace.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ Blockly.Workspace = function(opt_options) {
this.options = opt_options || {};
/** @type {boolean} */
this.RTL = !!this.options.RTL;
/** @type {boolean} */
this.horizontalLayout = !!this.options.horizontalLayout;
/** @type {!Array.<!Blockly.Block>} */
this.topBlocks_ = [];
};
Expand Down
3 changes: 2 additions & 1 deletion core/workspace_svg.js
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,8 @@ Blockly.WorkspaceSvg.prototype.addFlyout_ = function() {
var workspaceOptions = {
disabledPatternId: this.options.disabledPatternId,
parentWorkspace: this,
RTL: this.RTL
RTL: this.RTL,
horizontalLayout: this.horizontalLayout
};
/** @type {Blockly.Flyout} */
this.flyout_ = new Blockly.Flyout(workspaceOptions);
Expand Down
1 change: 1 addition & 0 deletions tests/horizontal_playground.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
scrollbars: true,
toolbox: toolbox,
trashcan: true,
horizontalLayout: true,
zoom: {
controls: true,
wheel: false,
Expand Down