[TikiWiki-commits] [Git][tikiwiki/tiki][27.x] [FIX] maps: Update info popup dialog height and reposition on screen if necessary.

"Jonny Bradley \(@jonnybradley\) via TikiWiki-cvs" <[email protected]>
Newsgroups gmane.comp.cms.tiki.cvs
Message-ID <69b8535868a86_3b18ce50360f7@gitlab-sidekiq-low-urgency-cpu-bound-v2-55577b99d4-86v8c.mail>

Jonny Bradley pushed to branch 27.x at Tiki Wiki CMS Groupware / Tiki


Commits:
2ede0f51 by Jonny Bradley at 2026-03-16T18:53:04+00:00
[FIX] maps: Update info popup dialog height and reposition on screen if necessary.
---
* [FIX] maps: Update info popup dialog height and reposition on screen if necessary.
TODO update in master if needed when possible (OpenLayers 2 has been removed from 27+)

See merge request tikiwiki/tiki!9763

- - - - -


1 changed file:

- lib/jquery_tiki/tiki-maps.js


Changes:

=====================================
lib/jquery_tiki/tiki-maps.js
=====================================
@@ -1754,10 +1754,12 @@
                     add: function (popup) {
                     },
                     create: function (lonlat, content, hook, close, feature) {
-                        var dialog = $(content), w = '80%', h = 600;
+                        var dialog = $(content), w = '80%', h = "auto";
                         this.feature = feature;
-                        if (this.feature.attributes.popup_config) {
+                        if (this.feature.attributes.popup_config.width) {
                             w = this.feature.attributes.popup_config.width;
+                        }
+                        if (this.feature.attributes.popup_config.height) {
                             h = this.feature.attributes.popup_config.height;
                         }
 
@@ -1778,6 +1780,16 @@
                             $(this).hide();
                             $(popup).dialog('option', 'title', $(this).text());
                         });
+                        // reposition the dialog on the screen if height was auto
+                        const height = $(popup).parents(".ui-dialog").height(),
+                            maxHeight = map.getViewport().clientHeight * 0.8;
+
+                        if (height > maxHeight) {
+                            $(popup)
+                                .height(maxHeight)
+                                .css("overflow-y", "scroll");
+                        }
+                        $(popup).dialog("option", "position", { my: "center", at: "center", of: window });
                     }
                 };
                 break;



View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/2ede0f511c5f57f8b845b3fad7c7e75df69d1da8

-- 
View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/2ede0f511c5f57f8b845b3fad7c7e75df69d1da8
You're receiving this email because of your account on gitlab.com. Manage all notifications: https://gitlab.com/-/profile/notifications | Help: https://gitlab.com/help

_______________________________________________
TikiWiki-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tikiwiki-cvs
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.