Commit 99244984 authored by Neil Fraser's avatar Neil Fraser

Enable trashcans in mutators.

parent ede63636
This diff is collapsed.
...@@ -101,6 +101,7 @@ Blockly.Mutator.prototype.createEditor_ = function() { ...@@ -101,6 +101,7 @@ Blockly.Mutator.prototype.createEditor_ = function() {
var workspaceOptions = { var workspaceOptions = {
languageTree: quarkXml, languageTree: quarkXml,
parentWorkspace: this.block_.workspace, parentWorkspace: this.block_.workspace,
pathToMedia: this.block_.workspace.options.pathToMedia,
RTL: this.block_.RTL, RTL: this.block_.RTL,
getMetrics: function() {return mutator.getFlyoutMetrics_();}, getMetrics: function() {return mutator.getFlyoutMetrics_();},
setMetrics: null, setMetrics: null,
...@@ -165,6 +166,7 @@ Blockly.Mutator.prototype.resizeBubble_ = function() { ...@@ -165,6 +166,7 @@ Blockly.Mutator.prototype.resizeBubble_ = function() {
var translation = 'translate(' + this.workspaceWidth_ + ',0)'; var translation = 'translate(' + this.workspaceWidth_ + ',0)';
this.workspace_.getCanvas().setAttribute('transform', translation); this.workspace_.getCanvas().setAttribute('transform', translation);
} }
this.workspace_.resize();
}; };
/** /**
...@@ -275,6 +277,7 @@ Blockly.Mutator.prototype.workspaceChanged_ = function() { ...@@ -275,6 +277,7 @@ Blockly.Mutator.prototype.workspaceChanged_ = function() {
* Return an object with all the metrics required to size scrollbars for the * Return an object with all the metrics required to size scrollbars for the
* mutator flyout. The following properties are computed: * mutator flyout. The following properties are computed:
* .viewHeight: Height of the visible rectangle, * .viewHeight: Height of the visible rectangle,
* .viewWidth: Width of the visible rectangle,
* .absoluteTop: Top-edge of view. * .absoluteTop: Top-edge of view.
* .absoluteLeft: Left-edge of view. * .absoluteLeft: Left-edge of view.
* @return {!Object} Contains size and position metrics of mutator dialog's * @return {!Object} Contains size and position metrics of mutator dialog's
...@@ -282,15 +285,11 @@ Blockly.Mutator.prototype.workspaceChanged_ = function() { ...@@ -282,15 +285,11 @@ Blockly.Mutator.prototype.workspaceChanged_ = function() {
* @private * @private
*/ */
Blockly.Mutator.prototype.getFlyoutMetrics_ = function() { Blockly.Mutator.prototype.getFlyoutMetrics_ = function() {
var left = 0;
if (this.block_.RTL) {
left += this.workspaceWidth_;
}
return { return {
viewHeight: this.workspaceHeight_, viewHeight: this.workspaceHeight_,
viewWidth: 0, // This seem wrong, but results in correct RTL layout. viewWidth: this.workspaceWidth_,
absoluteTop: 0, absoluteTop: 0,
absoluteLeft: left absoluteLeft: 0
}; };
}; };
......
...@@ -257,7 +257,7 @@ Blockly.Tooltip.show_ = function() { ...@@ -257,7 +257,7 @@ Blockly.Tooltip.show_ = function() {
// Move the tooltip to just below the cursor. // Move the tooltip to just below the cursor.
var anchorX = Blockly.Tooltip.lastX_; var anchorX = Blockly.Tooltip.lastX_;
if (rtl) { if (rtl) {
anchorX -= Blockly.Tooltip.OFFSET_X + width; anchorX -= Blockly.Tooltip.OFFSET_X + Blockly.Tooltip.DIV.offsetWidth;
} else { } else {
anchorX += Blockly.Tooltip.OFFSET_X; anchorX += Blockly.Tooltip.OFFSET_X;
} }
......
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