Permalink
Browse files

add jQuery Geo to top menu

  • Loading branch information...
ryanttb committed Nov 22, 2015
1 parent 1462aa3 commit d4cdb77faa3e884fb1606b9ba718f7946378aff4
Showing with 29 additions and 2 deletions.
  1. +1 −0 sensitive/functions.php
  2. +25 −1 sensitive/js/site.js
  3. +3 −1 sensitive/style.css
View
@@ -282,6 +282,7 @@ function sensitive_enqueue_scripts(){
wp_enqueue_style('wpeden-bootstrap',get_template_directory_uri().'/bootstrap/css/bootstrap.css');
wp_enqueue_style('wpeden-bootstrap-responsive',get_template_directory_uri().'/bootstrap/css/bootstrap-responsive.css');
wp_enqueue_script('wpeden-bootstrap',get_template_directory_uri().'/bootstrap/js/bootstrap.min.js',array('jquery'));
wp_enqueue_script('wpeden-jquery-geo',get_template_directory_uri().'/node_modules/jquery.geo/dist/jquery.geo-1.0.0-b3.js',array('jquery'));
wp_enqueue_script('wpeden-site',get_template_directory_uri().'/js/site.js',array('jquery'));
wp_enqueue_style('wpeden-main',get_stylesheet_uri());
wp_enqueue_script( 'comment-reply' );
View
@@ -20,4 +20,28 @@ jQuery(function(){
});
}
});
var map = null;
if (navigator.geolocation) {
navigator.geolocation.getCurrentPosition(function (p) {
initMap([p.coords.longitude, p.coords.latitude]);
}, function (error) {
initMap();
});
} else {
initMap();
}
function initMap(center) {
var mapCont = jQuery('.navbar-wrapper');
mapCont.prepend('<div class="geomap" style="position: absolute; left: 0; top: 0; right: 0; bottom: 0;">');
map = jQuery(".geomap").geomap({
center: center || [-71.0597732, 42.3584308],
zoom: 7
});
jQuery( ".osm" ).geomap("opacity", .5);
}
});
View
@@ -81,6 +81,7 @@ Sensitive - WordPress Theme is distributed under the terms of the GNU GPL
/* Special class on .container surrounding .navbar, used for positioning it into place. */
.navbar-wrapper{
position: relative;
padding-top: 20px;
padding-bottom: 0px;
margin-bottom: 20px;
@@ -1368,5 +1369,6 @@ object{
}
#topmenu{
position: relative;
z-index: 99999999;
}
}

0 comments on commit d4cdb77

Please sign in to comment.