Initial commit
This commit is contained in:
commit
28e6ddf404
1083 changed files with 191734 additions and 0 deletions
|
@ -0,0 +1,11 @@
|
|||
.contact-info-map-canvas {
|
||||
height: 216px;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
/* Prevent Google maps controls from being hidden */
|
||||
.gmnoprint img {
|
||||
max-width: none !important;
|
||||
}
|
|
@ -0,0 +1,41 @@
|
|||
/* global google */
|
||||
/* jshint unused:false */
|
||||
jQuery( function( $ ) {
|
||||
|
||||
function setupContactMaps( rootElement ) {
|
||||
rootElement = $( rootElement || document.body );
|
||||
|
||||
rootElement.find( 'div.contact-map' ).each( function() {
|
||||
|
||||
// get lat and lon from hidden input values
|
||||
var lat = jQuery(this).find('.contact-info-map-lat').val(),
|
||||
lon = jQuery(this).find('.contact-info-map-lon').val(),
|
||||
lat_lon = new google.maps.LatLng( lat, lon ),
|
||||
mapOptions = {
|
||||
zoom: 16,
|
||||
center: lat_lon,
|
||||
mapTypeId: google.maps.MapTypeId.ROADMAP
|
||||
},
|
||||
map = new google.maps.Map(jQuery(this).find('.contact-info-map-canvas')[0], mapOptions),
|
||||
marker = new google.maps.Marker({
|
||||
map: map,
|
||||
position: lat_lon
|
||||
});
|
||||
|
||||
google.maps.event.addListenerOnce(map, 'mouseover', function() {
|
||||
google.maps.event.trigger(map, 'resize');
|
||||
});
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
setupContactMaps();
|
||||
|
||||
if ( wp && wp.customize && wp.customizerHasPartialWidgetRefresh() ) {
|
||||
wp.customize.selectiveRefresh.bind( 'partial-content-rendered', function( placement ) {
|
||||
if ( wp.isJetpackWidgetPlaced( placement, 'widget_contact_info' ) ) {
|
||||
setupContactMaps( placement.container );
|
||||
}
|
||||
} );
|
||||
}
|
||||
} );
|
Reference in a new issue