MediaWiki talk:Gadget-ReferenceTooltips.js: Difference between revisions
Content deleted Content added
→Update request 9 July 2024: Reply |
→Update request 9 July 2024: Reply |
||
Line 251:
</syntaxhighlight>that would probably work, but it doesn't. <code>#mw-teleport-target</code> seems to be intended for fixed-positioned elements like dialogs only. [[User:JWBTH|Jack who built the house]] ([[User:JWBTH|talk]]) 12:51, 11 July 2024 (UTC)
::::::{{ping|Matma Rex}} Do you have a recommendation on where a script can insert tooltips so the font size etc. are the same as in the content body? [[User:Nardog|Nardog]] ([[User talk:Nardog|talk]]) 15:46, 11 July 2024 (UTC)
:::::::I believe that <code>#mw-teleport-target</code> was intended exactly for this use case. (As noted below, access it using <code>require( 'mediawiki.page.ready' ).teleportTarget</code>.) It's used by both Codex and OOUI and is meant to be usable by anything else.
:::::::I haven't looked at how it's used in Codex, but at least OOUI manages to use it to position not just dialogs, but also e.g. dropdown menus (like those on [[Special:Log]]).
:::::::You're right though that the position has to be calculated relative to the bottom of the screen… (I see things like <code>top: -2447.62px</code> on those OOUI dropdowns, which is a bit silly). I would guess nobody noticed because those libraries have generic methods to position anything relative to anything else, and they coped with the weirdness automatically. You might want to file a Phab task (and CC people who worked on the feature: https://gerrit.wikimedia.org/r/c/mediawiki/core/+/945825), or you'll have to make your code cope with it too. [[User:Matma Rex|Matma Rex]] <small>[[User talk:Matma Rex|talk]]</small> 16:57, 11 July 2024 (UTC)
::::<code>#mw-teleport-target</code> isn't served by HTML, so I assume you can't just expect it to be there but have to await something. [[User:Nardog|Nardog]] ([[User talk:Nardog|talk]]) 07:36, 10 July 2024 (UTC)
:::::https://phabricator.wikimedia.org/source/mediawiki/browse/master/resources/src/mediawiki.page.ready/ready.js<syntaxhighlight lang="js">
|