1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-11-24 02:27:19 +00:00
TiddlyWiki5/core/modules/utils
FlashSystems 5b85786f73
Fix popup position if popup is triggered from within an offsetParent element (#6887)
* 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`.
2022-10-22 13:13:39 +01:00
..
base64-utf8 Fix incorrect base64 encoding of astral-plane text (#4813) 2020-08-17 17:33:46 +01:00
diff-match-patch Incorporate “diff” engine to show visual differences (#3112) 2018-03-16 20:38:35 +00:00
dom Fix popup position if popup is triggered from within an offsetParent element (#6887) 2022-10-22 13:13:39 +01:00
crypto.js Introduce JSON parse utility function with error handling (#6401) 2022-02-21 15:29:25 +00:00
csv.js style(App) eliminate whitespace at the end of code lines (#5735) 2021-05-30 19:20:17 +01:00
edition-info.js Introduce JSON parse utility function with error handling (#6401) 2022-02-21 15:29:25 +00:00
escapecss.js Change css-escape-polyfill to a tw uitility method (#5552) 2021-04-02 09:25:01 +01:00
fakedom.js Optimise fake dom 2022-09-23 18:09:45 +01:00
filesystem.js Ensure tiddlers with fieldnames containing colons don't get saved in .tid file format 2021-06-27 21:27:57 +01:00
linked-list.js Optimise LinkedList filter ops to return iterator instead of array (#6035) 2021-09-16 22:22:44 +01:00
logger.js Log message not to have spaces and <empty string> (#6947) 2022-09-15 12:10:33 +01:00
parsetree.js Fix handling of orderedattributes when adding classes/styles 2022-10-16 17:27:46 +01:00
performance.js style(App) eliminate whitespace at the end of code lines (#5735) 2021-05-30 19:20:17 +01:00
pluginmaker.js Introduce JSON parse utility function with error handling (#6401) 2022-02-21 15:29:25 +00:00
transliterate.js Additional transliteration pairs 2021-09-24 18:29:40 +01:00
utils.js Allow toggling wrap-lines text operations (like mono block) (#6698) 2022-05-17 22:16:54 +02:00