From: Steve Sutton Date: Wed, 29 Aug 2018 18:53:59 +0000 (-0400) Subject: Update list view for theme X-Git-Tag: v1.0.17^2~6 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/?a=commitdiff_plain;h=94ec8ee500a7c8a2f92f38ed72be1bbaa37c7362;p=WP-Themes%2Fmichigantrailmaps.git Update list view for theme For phone numbers and the limit on short-desc --- diff --git a/glm-member-db/views/front/members/list.html b/glm-member-db/views/front/members/list.html index d69b31c..ce7fecc 100644 --- a/glm-member-db/views/front/members/list.html +++ b/glm-member-db/views/front/members/list.html @@ -211,14 +211,14 @@ Search Terms: {/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}Website: {$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.url && $settings.list_map_show_url}Website
{/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.descr && $settings.list_map_show_descr}{$m.descr|nl2br}
{/if} - {if $m.short_descr && $settings.list_map_show_short_descr}{$m.short_descr}
{/if} + {if $m.short_descr && $settings.list_map_show_short_descr}{$m.short_descr|truncate:250}
{/if} {if $m.categories && $settings.list_map_show_categories}
{$terms.term_member_cap} Categories @@ -717,6 +717,13 @@ Search Terms: }); {/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} @@ -724,7 +731,8 @@ Search Terms: // 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(), { - maxWidth: 600 + maxWidth: maxPopupWidth, + maxHeight: maxPopupHeight }) .addTo(markerGroup); @@ -742,8 +750,8 @@ Search Terms: leafletMap.on('popupopen', function(e) { var px = leafletMap.project(e.popup._latlng); - px.x -= 20; - 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 }); });