Commit 2d11522c authored by Neil Fraser's avatar Neil Fraser

Stop Firefox from jumping when widget div is displayed. Issue 186.

parent 6f924e34
......@@ -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';
};
......
......@@ -87,8 +87,8 @@ function start() {
{enabled: true,
controls: true,
wheel: true,
maxScale: 2,
minScale: .1,
maxScale: 4,
minScale: .25,
scaleSpeed: 1.1
},
});
......
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