From 19994b888660a7246b7bb7e73a747c3f6bfc1ea8 Mon Sep 17 00:00:00 2001 From: Steve Sutton Date: Thu, 30 Aug 2018 16:56:25 -0400 Subject: [PATCH] Updates from main plugin Updates for the map popups for mobile views. --- glm-member-db/views/front/members/list.html | 34 +++++++++++++++------ style.css | 2 +- 2 files changed, 26 insertions(+), 10 deletions(-) diff --git a/glm-member-db/views/front/members/list.html b/glm-member-db/views/front/members/list.html index 58a1ee6..ffb3e7e 100644 --- a/glm-member-db/views/front/members/list.html +++ b/glm-member-db/views/front/members/list.html @@ -118,7 +118,7 @@ {if $settings.selected_map_interface == 1} -
+
{/if} {if $settings.selected_map_interface == 2} @@ -165,15 +165,20 @@

{/if} {*list_map_show_address*}
-

- {if $m.phone && $settings.list_map_show_phone}Phone: {apply_filters('glm_associate_phone_filter', $m.phone)}
{/if} - {if $m.toll_free && $settings.list_map_show_tollfree}{apply_filters('glm_associate_phone_filter', $m.toll_free)}
{/if} - {if $m.url && $settings.list_map_show_url}Web site: {$m.url}
{/if} +

+ {if $m.phone && $settings.list_map_show_phone}Phone: {apply_filters('glm_associate_phone_filter', $m.phone)}
{/if} + {if $m.toll_free && $settings.list_map_show_tollfree}{apply_filters('glm_associate_phone_filter', $m.toll_free)}
{/if} {if $m.email && $settings.list_map_show_email}E-Mail Address: {$m.email}
{/if} - {if $m.region && $settings.list_map_show_region}Region: {$m.region}{/if} + {if $m.region && $settings.list_map_show_region}Region: {$m.region}
{/if} + {if $m.url && $settings.list_map_show_url}Website
{/if}

+ + {if $m.short_descr && $settings.list_map_show_short_descr}{$m.short_descr|truncate:200}
{/if} + {if $settings.list_map_show_detaillink && !$m.has_no_profile} + More Info + {/if} {if $m.categories && $settings.list_map_show_categories}
{$terms.term_member_cap} Categories @@ -579,13 +584,23 @@ }); {/if} + var mapContainerWidth = Number(leafletMap._container.clientWidth); + var maxPopupWidth = .65 * mapContainerWidth; + if (maxPopupWidth > 600) { + maxPopupWidth = 600; + } + var mapContainerHeight = Number(leafletMap._container.clientHeight); + var maxPopupHeight = .7 * mapContainerHeight; {foreach $mapItems as $m} {if $m.lat != 0 && $m.lon != 0} // Create marker for this member and and to Feature Group var leafletMarker = L.marker([{$m.lat}, {$m.lon}], { title: '{$m.member_name|escape:quotes}' }) - .bindPopup($('#map_info_' + {$m.id}).html()) + .bindPopup($('#map_info_' + {$m.id}).html(), { + maxWidth: maxPopupWidth, + maxHeight: maxPopupHeight + }) .addTo(markerGroup); {/if} @@ -602,7 +617,8 @@ leafletMap.on('popupopen', function(e) { var px = leafletMap.project(e.popup._latlng); - px.y -= e.popup._container.clientHeight/2; + px.x -= 20; // Bump a bit to the right to avoid resize buttons + px.y -= e.popup._container.clientHeight/2; // Position more toward the center leafletMap.panTo(leafletMap.unproject(px),{ animate: true }); }); diff --git a/style.css b/style.css index b398a97..d68a907 100644 --- a/style.css +++ b/style.css @@ -3,5 +3,5 @@ Theme Name: visitbenzie Author: Gaslight Media Author URI: http://www.gaslightmedia.com Description: A theme for Benzie Area Visitors Bureau -Version: 1.0.27 +Version: 1.0.28 */ -- 2.17.1