From 6208ba62fbd17c7bd3c9459c320603b1b900bb1d Mon Sep 17 00:00:00 2001 From: Rachel Fenichel Date: Wed, 25 May 2016 13:47:19 -0700 Subject: [PATCH] Rename a variable for clarity --- core/flyout.js | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/core/flyout.js b/core/flyout.js index b52708710..c7c0b05ed 100644 --- a/core/flyout.js +++ b/core/flyout.js @@ -324,29 +324,31 @@ Blockly.Flyout.prototype.position = function() { if (!this.isVisible()) { return; } - var metrics = this.targetWorkspace_.getMetrics(); - if (!metrics) { + var targetWorkspaceMetrics = this.targetWorkspace_.getMetrics(); + if (!targetWorkspaceMetrics) { // Hidden components will return null. return; } - var edgeWidth = this.horizontalLayout_ ? metrics.viewWidth : this.width_; + var edgeWidth = this.horizontalLayout_ ? + targetWorkspaceMetrics.viewWidth : this.width_; edgeWidth -= this.CORNER_RADIUS; if (this.toolboxPosition_ == Blockly.TOOLBOX_AT_RIGHT) { edgeWidth *= -1; } this.setBackgroundPath_(edgeWidth, - this.horizontalLayout_ ? this.height_ : metrics.viewHeight); + this.horizontalLayout_ ? this.height_ : + targetWorkspaceMetrics.viewHeight); - var x = metrics.absoluteLeft; + var x = targetWorkspaceMetrics.absoluteLeft; if (this.toolboxPosition_ == Blockly.TOOLBOX_AT_RIGHT) { - x += metrics.viewWidth; + x += targetWorkspaceMetrics.viewWidth; x -= this.width_; } - var y = metrics.absoluteTop; + var y = targetWorkspaceMetrics.absoluteTop; if (this.toolboxPosition_ == Blockly.TOOLBOX_AT_BOTTOM) { - y += metrics.viewHeight; + y += targetWorkspaceMetrics.viewHeight; y -= this.height_; } @@ -355,9 +357,9 @@ Blockly.Flyout.prototype.position = function() { // Record the height for Blockly.Flyout.getMetrics_, or width if the layout is // horizontal. if (this.horizontalLayout_) { - this.width_ = metrics.viewWidth; + this.width_ = targetWorkspaceMetrics.viewWidth; } else { - this.height_ = metrics.viewHeight; + this.height_ = targetWorkspaceMetrics.viewHeight; } // Update the scrollbar (if one exists).