diff --git a/core/widgetdiv.js b/core/widgetdiv.js index 36eb916b7..3342aa365 100644 --- a/core/widgetdiv.js +++ b/core/widgetdiv.js @@ -30,6 +30,7 @@ goog.provide('Blockly.WidgetDiv'); goog.require('Blockly.Css'); goog.require('goog.dom'); +goog.require('goog.style'); /** @@ -75,6 +76,10 @@ Blockly.WidgetDiv.show = function(newOwner, rtl, dispose) { Blockly.WidgetDiv.hide(); Blockly.WidgetDiv.owner_ = newOwner; Blockly.WidgetDiv.dispose_ = dispose; + // Temporarily move the widget to the top of the screen so that it does not + // cause a scrollbar jump in Firefox when displayed. + var xy = goog.style.getViewportPageOffset(document); + Blockly.WidgetDiv.DIV.style.top = xy.y + 'px'; Blockly.WidgetDiv.DIV.style.direction = rtl ? 'rtl' : 'ltr'; Blockly.WidgetDiv.DIV.style.display = 'block'; }; diff --git a/tests/playground.html b/tests/playground.html index 96a09272b..224ad61b4 100644 --- a/tests/playground.html +++ b/tests/playground.html @@ -87,8 +87,8 @@ function start() { {enabled: true, controls: true, wheel: true, - maxScale: 2, - minScale: .1, + maxScale: 4, + minScale: .25, scaleSpeed: 1.1 }, });