$(window).load(function(){
$(".dot-wrapper").trigger("update.dot");
/*function hide_placecard(){
$("#gmaps-iframe").contents().find(".place-card-large").attr("display","none");
console.log('fired');
};
window.setTimeout( hide_placecard, 5000 );*/
});
$(document).ready(function(){
$("#href-z-obce").on('click', function(event){
//prevent the default action for the click event
event.preventDefault();
var active = $( '#btn-z-obce' ).hasClass('is-active');
if(active){
$( '#btn-z-obce' ).removeClass('is-active');
$( '#menu-z-obce' ).slideUp(500);
}else{
$( '#menu-z-uradu' ).slideUp(500, function(){
$( '#btn-z-obce' ).addClass('is-active');
$( '#menu-z-obce' ).slideDown(500);
});
$( '#btn-z-uradu' ).removeClass('is-active');
}
});
$("#href-z-uradu").on('click', function(event){
//prevent the default action for the click event
event.preventDefault();
var active = $( '#btn-z-uradu' ).hasClass('is-active');
if(active){
$( '#btn-z-uradu' ).removeClass('is-active');
$( '#menu-z-uradu' ).slideUp(500);
}else{
$( '#menu-z-obce' ).slideUp(500, function(){
$( '#btn-z-uradu' ).addClass('is-active');
$( '#menu-z-uradu' ).slideDown(500);
});
$( '#btn-z-obce' ).removeClass('is-active');
}
});
$(".menuTopSub").hover(
function() {
$(this).children('ul').show();
},
function(){
$(this).children('ul').hide();
}
);
// ošetřujeme lazy loading obrázků
$( 'article img').not('img.banner').not('img.setmeup').each(function( index ) {
var imageObj = $( this );
var src = $( this ).attr('src');
//prepend '/' to the relative 'uc/' path if not already there
var subSrc = src.substring(0,3);
var subSrc2 = src.substring(0,15);
if(subSrc === 'uc/'){
var changedSrc = src.replace('uc/', '/uc/');
src = changedSrc;
}else if(subSrc2 === '../../../../uc/'){
var changedSrc = src.replace('../../../../uc/', '/uc/');
src = changedSrc;
}
$( this ).attr('data-original', src);
$( this ).attr('src', '/ui/images/transparent.gif');
$( this ).removeClass( 'lazyload' );
$( this ).addClass( 'lazyload' );
});
$( 'img.lazyload' ).lazyload({
/*effect : "fadeIn"*/
});
$(".fancybox").jqPhotoSwipe({
galleryOpen: function (gallery) {
//with `gallery` object you can access all methods and properties described here http://photoswipe.com/documentation/api.html
//console.log(gallery);
//console.log(gallery.currItem);
//console.log(gallery.getCurrentIndex());
//gallery.zoomTo(1, {x:gallery.viewportSize.x/2,y:gallery.viewportSize.y/2}, 500);
//gallery.toggleDesktopZoom();
}
});
$(".dot-wrapper").dotdotdot({
watch: "window"
});
$('input#od, input#do').pickadate(
{
selectMonths: true,
selectYears: true
}
);
$("a.b-lupa").on('click', function(event){
//prevent the default action for the click event
event.preventDefault();
$("form#top-query-form").submit();
});
$("a.b-date-clear").on('click', function(event){
//prevent the default action for the click event
event.preventDefault();
$(this).parent().parent().children('input#od').val('');
$(this).parent().children('input#do').val('');
});
$("a.b-date-clear.query").on('click', function(event){
//prevent the default action for the click event
event.preventDefault();
$(this).parent().children('input#query').val('');
});
$("a.openMarker").on('click', function(event){
//prevent the default action for the click event
event.preventDefault();
var id = $(this).attr('data-id');
var aTag = $("a[name='gMap']");
$('html,body').animate({scrollTop: aTag.offset().top}, 'slow', function () {
if (id) {
//console.log('bound click');
openMarker(id);
}
});
});
// FILTRY
$(".filtry-bar-up").on('click', function(event){
$(".filtry-bar-up").addClass('hidden');
$(".filtry-bar-down").removeClass('hidden');
$(".box-filtry").slideDown('slow', function(){
//$(".filtry-buttons").show();
$(".filtry-bar-up").unbind('click', function(){
});
});
});
$(".filtry-bar-down").on('click', function(event){
//$(".filtry-buttons").hide();
$(".box-filtry").slideUp('slow', function(){
$(".filtry-bar-down").addClass('hidden');
$(".filtry-bar-up").removeClass('hidden');
});
});
});