Commit 112a65a0 authored by Evan W. Patton's avatar Evan W. Patton Committed by Jeffrey Schiller

Suppress closing backpack on right click (#1271)

Change-Id: Icef6b14f0248258189a764989778e0aba9ce4c05
parent 97102b94
...@@ -218,6 +218,7 @@ Blockly.Backpack.prototype.init = function() { ...@@ -218,6 +218,7 @@ Blockly.Backpack.prototype.init = function() {
Blockly.bindEvent_(this.svgBody_, 'click', this, this.openBackpack); Blockly.bindEvent_(this.svgBody_, 'click', this, this.openBackpack);
Blockly.bindEvent_(this.svgBody_, 'contextmenu', this, this.openBackpackDoc); Blockly.bindEvent_(this.svgBody_, 'contextmenu', this, this.openBackpackDoc);
this.flyout_.init(this.workspace_); this.flyout_.init(this.workspace_);
this.flyout_.workspace_.isBackpack = true;
// load files for sound effect // load files for sound effect
Blockly.getMainWorkspace().loadAudio_(['assets/backpack.mp3', 'assets/backpack.ogg', 'assets/backpack.wav'], 'backpack'); Blockly.getMainWorkspace().loadAudio_(['assets/backpack.mp3', 'assets/backpack.ogg', 'assets/backpack.wav'], 'backpack');
......
...@@ -41,9 +41,10 @@ Blockly.hideChaff = (function(func) { ...@@ -41,9 +41,10 @@ Blockly.hideChaff = (function(func) {
return func; return func;
} else { } else {
var f = function() { var f = function() {
func.apply(this, Array.prototype.slice.call(arguments)); var argCopy = Array.prototype.slice.call(arguments);
func.apply(this, argCopy);
// [lyn, 10/06/13] for handling parameter & procedure flydowns // [lyn, 10/06/13] for handling parameter & procedure flydowns
Blockly.getMainWorkspace().hideChaff(); Blockly.WorkspaceSvg.prototype.hideChaff.call(Blockly.getMainWorkspace(), argCopy);
}; };
f.isWrapped = true; f.isWrapped = true;
return f; return f;
......
...@@ -483,10 +483,12 @@ Blockly.WorkspaceSvg.prototype.getFlydown = function() { ...@@ -483,10 +483,12 @@ Blockly.WorkspaceSvg.prototype.getFlydown = function() {
return this.flydown_; return this.flydown_;
}; };
Blockly.WorkspaceSvg.prototype.hideChaff = function() { Blockly.WorkspaceSvg.prototype.hideChaff = function(opt_allowToolbox) {
this.flydown_ && this.flydown_.hide(); this.flydown_ && this.flydown_.hide();
this.typeBlock_ && this.typeBlock_.hide(); this.typeBlock_ && this.typeBlock_.hide();
this.backpack_ && this.backpack_.hide(); if (!opt_allowToolbox) { // Fixes #1269
this.backpack_ && this.backpack_.hide();
}
this.setScrollbarsVisible(true); this.setScrollbarsVisible(true);
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment