mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Popups
synced 2024-12-18 18:20:51 +00:00
4492b54a44
Reduce layout/style thrashing by measuring all required geometries at event handler, not waiting for delays/redux/style changes. Use CSS bottom instead of top, to avoid having to measure the popup before positioning it, if it's placed above the link ("flippedY"). Disable some test cases that relied on implementation detail of using "top" CSS. Change-Id: Id0cbf506009b824d0fb6af4d6fe220e2f69aaaad
18 lines
344 B
JavaScript
18 lines
344 B
JavaScript
/**
|
|
* Grid helper for absolutely positioning popups on page.
|
|
*/
|
|
const grid = {
|
|
landscape: {
|
|
row: ( x ) => 50 + ( ( x - 1 ) * 300 ),
|
|
col: ( x ) => 50 + ( ( x - 1 ) * 500 ),
|
|
flipOffset: 250
|
|
},
|
|
portrait: {
|
|
row: ( x ) => 50 + ( ( x - 1 ) * 450 ),
|
|
col: ( x ) => 50 + ( ( x - 1 ) * 400 ),
|
|
flipOffset: 400
|
|
},
|
|
}
|
|
|
|
export default grid;
|