1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-11-29 21:09:56 +00:00
TiddlyWiki5/core/modules/utils/dom
FlashSystems 3918e59cc1
Fixed PR to fix popup position if popup is triggered from within an offsetParent element (#7013)
* Fix popup location for tables

This commit introduces the `popupAbsCoords` option to the $button widget
and implements an absolut coordinate format.

Coordinates for popups are stored in the format `(x,y,w,h)`. These
coordinates are relative to the offset parent of the element that
defines the popup.

This commits adds a second format `@(x,y,w,h)`. Coordinates specified in
this format a relative to the pages root element.

The `popupAbsCoords` option of the $button widget enables the use of
this coordinates.

* Unify the declaration of the RegEx for parsing the popup-position

The regular expression was declared in three locations with the same
content. This commit supplies a new function `parseCoordinates` in
`popup.js`. This function returns the parsed coordinates and understands
the classic/absolute coordinates.

This function is used in `reveal.js` and `action-popup.js` to parse the
coordinates.

* Add documentation for coordinate systems

* Consolidate creating coordinate strings

The Popup object now contains a `buildCoordinates` method that can be
used to build coordinate strings. It takes an "enum" for the coordinate-
system to use. This makes everything easily extensible and prevents the
use of magic values.

* Add tests for `parseCoordinates` and `buildCoordinates`

* Add `tv-popup-abs-coords` to `collectDOMVariables`

This will make the absolute coordinates available for the
`DraggableWidget` and the `EventCatcherWidget`.

* Add documentation for the `tv-popup-abs-coords`

... to the `DraggableWidget` and the `EventCatcherWidget`.

* Fix crash when generating a static version of the TW

The Popup class is not initialized in `startup.js` if `$tw.browser` is
not true. After having consolidated the facilities for parsing
coordinate strings into `popup.js` this breaks because the static build
needs to parse coordinate stings even if no Popup module is initialized.
This commit solves this problem by making `readPopupState`,
`parseCoordinates` and `buildCoordinates` static methods of `popup.js`.
It also adds a comment to these functions to show that these can be called
safely even if the Popup-Class is not initialized.
2022-12-01 21:16:44 +00:00
..
animations Restored animations for the reveal widget 2013-11-01 17:23:08 +00:00
animator.js Fix animation behaviour of reveal widget 2013-11-02 09:21:11 +00:00
browser.js Limited implementation of external text tiddlers in the browser 2015-08-29 16:33:04 +01:00
csscolorparser.js Provisionally make tag pill foreground colour be responsive 2014-11-06 13:35:48 +00:00
csscolorparser.js.meta Provisionally make tag pill foreground colour be responsive 2014-11-06 13:35:48 +00:00
dom.js Fixed PR to fix popup position if popup is triggered from within an offsetParent element (#7013) 2022-12-01 21:16:44 +00:00
dragndrop.js Fix: restore drag and drop on mobile chrome (#6789) 2022-07-15 18:19:44 +01:00
http.js Do not add X-Requested-With header for simple requests (#5931) 2021-08-17 09:56:52 +01:00
keyboard.js Introduce text editor toolbar (#2315) 2016-04-22 08:36:29 +01:00
modal.js Prevent scrolling of the page when modals are displayed (#5816) 2021-06-27 16:24:06 +01:00
notifier.js Add alert role to notifications so they're automatically spoken by screen readers. (#6743) 2022-06-28 17:48:03 +01:00
popup.js Fixed PR to fix popup position if popup is triggered from within an offsetParent element (#7013) 2022-12-01 21:16:44 +00:00
scroller.js Add support to tm-scroll message for scrolling without animating (#6410) 2022-01-24 09:44:04 +00:00