$(function() { $('body').on('click', '[data-type="download"]', function(e) { window.location.href = $(this).data('href'); return false; }); $('body').on('click', '[data-open]', function(e) { e.preventDefault(); var $this = $(this); var $remote = $this.attr('href') || $this.data('href'); var $modalID = $this.data('open'); if ($('#' + $modalID).length > 0){ $('#' + $modalID).remove(); } $('body').append(''); $.get($remote, function(html) { $('#' + $modalID).html(html); $('#' + $modalID).modal({keyboard: false}); }); }); $('body').on('click', '[data-close], .modal-header .close', function(e) { e.preventDefault(); var $modalID = $(this).data('close'); if ($modalID == 'this') { $(this).parents('.modal').modal('hide'); $(this).parents('.modal').remove(); } else { $('#' + $modalID).modal('hide'); $('#' + $modalID).remove(); } }); if ($('.mapCanvas').length > 0) { $.getScript('https://www.google.com/jsapi', function() { google.load('maps', '3', {callback: function() { $('.mapCanvas').each(function(){ var geocoder = new google.maps.Geocoder(); var opt = { zoom: 11, scrollwheel: false, mapTypeId: google.maps.MapTypeId.ROADMAP } var map = new google.maps.Map($(this)[0], opt); var address = $(this).attr('data-title'); geocoder.geocode( { 'address': address}, function(results, status) { if (status == google.maps.GeocoderStatus.OK) { map.setCenter(results[0].geometry.location); var marker = new google.maps.Marker({ map: map, position: results[0].geometry.location }); //google.maps.event.addListener(map, 'click', function() { window.open("http://maps.google.de/?q=" + encodeURI(address)); }); } }); }); }}); }); } // equal row height function equalRowHeight(){ var rowHeight = $(".equal").parent('.row').height(); $('.equal').each(function(){ $(this).height(rowHeight); }); } equalRowHeight(); });