MediaWiki:Gadget-Tooltips.js: Difference between revisions

Jump to navigation Jump to search
m
Removed 'let's, seems it won't parse
m (replaced let with var due to parse error in console?)
m (Removed 'let's, seems it won't parse)
Line 63: Line 63:
/** Update horizontal position variables if it will stick off the screen */
/** Update horizontal position variables if it will stick off the screen */
// TODO: Currently assumes the tooltip fits screen horizontally
// TODO: Currently assumes the tooltip fits screen horizontally
var horizontal_shift = 0;
if (screen_pos_left < 0) {
if (screen_pos_left < 0) {
let horizontal_shift = -screen_pos_left + EDGE_BUFFER;
horizontal_shift = -screen_pos_left + EDGE_BUFFER;
pos_left += horizontal_shift;
pos_left += horizontal_shift;
caret_margin_left -= horizontal_shift;
caret_margin_left -= horizontal_shift;
} else if (screen_pos_right > windowWidth) {
} else if (screen_pos_right > windowWidth) {
let horizontal_shift = screen_pos_right - windowWidth + EDGE_BUFFER;
horizontal_shift = screen_pos_right - windowWidth + EDGE_BUFFER;
pos_left -= horizontal_shift;
pos_left -= horizontal_shift;
caret_margin_left += horizontal_shift;
caret_margin_left += horizontal_shift;
3,972

edits

Navigation menu