MediaWiki:Gadget-Tooltips.js: Difference between revisions
Jump to navigation
Jump to search
m
Removed 'let's, seems it won't parse
KokoroSenshi (talk | contribs) m (replaced let with var due to parse error in console?) |
KokoroSenshi (talk | contribs) 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) { | ||
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) { | ||
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; |