PluginProbe
Maps Widget for Google Maps / 2.25
Maps Widget for Google Maps v2.25
1.86 1.90 1.92 1.93 1.95 2.0 2.01 2.05 2.06 2.10 2.15 2.20 2.25 2.30 2.35 2.40 2.45 2.50 2.51 2.60 2.65 2.66 2.70 2.75 2.80 All 129 releases
google-maps-widget / js / gmw.js

gmw.js in Maps Widget for Google Maps 2.25, at js/gmw.js

39 lines 1.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 /*
2 * Google Maps Widget
3 * (c) Web factory Ltd, 2012 - 2015
4 */
5
6 jQuery(function($) {
7 $('a.gmw-thumbnail-map.gmw-lightbox-enabled').click(function(e) {
8 e.preventDefault();
9
10 dialog = $($(this).attr('href'));
11 map_width = dialog.attr('data-map-width');
12 map_height = dialog.attr('data-map-height');
13 map_url = dialog.attr('data-map-iframe-url');
14 map_title = dialog.attr('title');
15 map_skin = dialog.attr('data-map-skin');
16
17 // adjust map size if screen is too small
18 screen_width = $(window).width() - 50;
19 if (screen_width < map_width) {
20 map_width = screen_width;
21 map_height *= screen_width / map_width;
22 }
23 screen_height = $(window).height() - 50;
24 if (screen_height < map_height) {
25 map_height = screen_height;
26 map_width *= screen_height / map_height;
27 }
28
29 content = $(dialog.html());
30 content.filter('.gmw-map').html('<iframe width="' + map_width + 'px" height="' + map_height + 'px" src="' + map_url + '"></iframe>');
31
32 $.colorbox({ html: content,
33 title: map_title,
34 className: 'gmw-' + map_skin,
35 closeButton: false });
36
37 return false;
38 });
39 }); // onload