From: Steve Sutton Date: Thu, 30 Aug 2018 20:36:02 +0000 (-0400) Subject: Updates from main plugin X-Git-Tag: v1.0.22^2~1 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/?a=commitdiff_plain;h=a3361b9ac8f96c5b1f44889fff6d737ecfb169bd;p=WP-Themes%2Fdiscoverkalamazoo2018.git Updates from main plugin For the map popups in mobile view. --- diff --git a/glm-member-db/views/front/members/list.html b/glm-member-db/views/front/members/list.html index e1cdc27..c694850 100644 --- a/glm-member-db/views/front/members/list.html +++ b/glm-member-db/views/front/members/list.html @@ -166,15 +166,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 @@ -571,13 +576,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} @@ -594,7 +609,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 }); });