Commit bd144f14 authored by Neil Fraser's avatar Neil Fraser

Fix tooltip location when page is scrolled.

Also of note, Closure Compiler is no longer preserving licences.
parent 877b5d3f
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -597,7 +597,7 @@ goog.addDependency("i18n/numberformatsymbolsext.js", ['goog.i18n.NumberFormatSym
goog.addDependency("i18n/ordinalrules.js", ['goog.i18n.ordinalRules'], []);
goog.addDependency("i18n/pluralrules.js", ['goog.i18n.pluralRules'], []);
goog.addDependency("i18n/pluralrules_test.js", ['goog.i18n.pluralRulesTest'], ['goog.i18n.pluralRules', 'goog.testing.jsunit']);
goog.addDependency("i18n/timezone.js", ['goog.i18n.TimeZone'], ['goog.array', 'goog.date.DateLike', 'goog.string']);
goog.addDependency("i18n/timezone.js", ['goog.i18n.TimeZone'], ['goog.array', 'goog.date.DateLike', 'goog.object', 'goog.string']);
goog.addDependency("i18n/timezone_test.js", ['goog.i18n.TimeZoneTest'], ['goog.i18n.TimeZone', 'goog.testing.jsunit']);
goog.addDependency("i18n/uchar.js", ['goog.i18n.uChar'], []);
goog.addDependency("i18n/uchar_test.js", ['goog.i18n.uCharTest'], ['goog.i18n.uChar', 'goog.testing.jsunit']);
......
This diff is collapsed.
......@@ -300,6 +300,8 @@ class Gen_compressed(threading.Thread):
code = code.replace(remove, "")
# Trim down Google's Apache licences.
# The Closure Compiler used to preserve these until August 2015.
# Delete this in a few months if the licences don't return.
LICENSE = re.compile("""/\\*
[\w ]+
......
......@@ -194,8 +194,8 @@ Blockly.Tooltip.onMouseMove_ = function(e) {
if (Blockly.Tooltip.visible) {
// Compute the distance between the mouse position when the tooltip was
// shown and the current mouse position. Pythagorean theorem.
var dx = Blockly.Tooltip.lastX_ - e.clientX;
var dy = Blockly.Tooltip.lastY_ - e.clientY;
var dx = Blockly.Tooltip.lastX_ - e.pageX;
var dy = Blockly.Tooltip.lastY_ - e.pageY;
var dr = Math.sqrt(Math.pow(dx, 2) + Math.pow(dy, 2));
if (dr > Blockly.Tooltip.RADIUS_OK) {
Blockly.Tooltip.hide();
......@@ -204,8 +204,8 @@ Blockly.Tooltip.onMouseMove_ = function(e) {
// The mouse moved, clear any previously scheduled tooltip.
clearTimeout(Blockly.Tooltip.showPid_);
// Maybe this time the mouse will stay put. Schedule showing of tooltip.
Blockly.Tooltip.lastX_ = e.clientX;
Blockly.Tooltip.lastY_ = e.clientY;
Blockly.Tooltip.lastX_ = e.pageX;
Blockly.Tooltip.lastY_ = e.pageY;
Blockly.Tooltip.showPid_ =
setTimeout(Blockly.Tooltip.show_, Blockly.Tooltip.HOVER_MS);
}
......@@ -263,16 +263,17 @@ Blockly.Tooltip.show_ = function() {
}
var anchorY = Blockly.Tooltip.lastY_ + Blockly.Tooltip.OFFSET_Y;
if (anchorY + Blockly.Tooltip.DIV.offsetHeight > windowSize.height) {
if (anchorY + Blockly.Tooltip.DIV.offsetHeight >
windowSize.height + window.scrollY) {
// Falling off the bottom of the screen; shift the tooltip up.
anchorY -= Blockly.Tooltip.DIV.offsetHeight + 2 * Blockly.Tooltip.OFFSET_Y;
}
if (rtl) {
// Prevent falling off left edge in RTL mode.
anchorX = Math.max(Blockly.Tooltip.MARGINS, anchorX);
anchorX = Math.max(Blockly.Tooltip.MARGINS - window.scrollX, anchorX);
} else {
if (anchorX + Blockly.Tooltip.DIV.offsetWidth >
windowSize.width - 2 * Blockly.Tooltip.MARGINS) {
windowSize.width + window.scrollX - 2 * Blockly.Tooltip.MARGINS) {
// Falling off the right edge of the screen;
// clamp the tooltip on the edge.
anchorX = windowSize.width - Blockly.Tooltip.DIV.offsetWidth -
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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