mirror of
https://github.com/google/blockly.git
synced 2026-01-09 18:10:08 +01:00
Stop Firefox from jumping when widget div is displayed. Issue 186.
This commit is contained in:
@@ -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
|
||||
},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user