2016-03-10 03:23:27 +01:00
|
|
|
/* ==========================================================================
|
|
|
|
jQuery plugin settings and other scripts
|
|
|
|
========================================================================== */
|
2014-02-13 20:20:28 +01:00
|
|
|
|
2016-03-10 19:06:17 +01:00
|
|
|
$(document).ready(function(){
|
2014-02-13 20:20:28 +01:00
|
|
|
|
2016-03-10 19:06:17 +01:00
|
|
|
// FitVids init
|
|
|
|
$("#main").fitVids();
|
2013-09-09 16:12:07 +02:00
|
|
|
|
2016-03-10 19:06:17 +01:00
|
|
|
// init sticky sidebar
|
|
|
|
$(".sticky").Stickyfill();
|
2013-09-09 16:12:07 +02:00
|
|
|
|
2016-03-17 20:38:07 +01:00
|
|
|
var stickySideBar = function(){
|
|
|
|
var windowWidth = $(window).width();
|
2016-03-20 20:20:33 +01:00
|
|
|
if (windowWidth > 1024) {
|
2016-03-17 20:38:07 +01:00
|
|
|
// fix
|
|
|
|
Stickyfill.rebuild();
|
|
|
|
Stickyfill.init();
|
|
|
|
} else {
|
|
|
|
// unfix
|
|
|
|
Stickyfill.stop();
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
stickySideBar();
|
|
|
|
|
|
|
|
$(window).resize(function(){
|
|
|
|
stickySideBar();
|
|
|
|
});
|
|
|
|
|
2016-03-21 05:03:46 +01:00
|
|
|
// Follow menu drop down
|
2016-03-17 20:38:07 +01:00
|
|
|
|
2016-03-21 21:01:19 +01:00
|
|
|
$(".author__urls-wrapper button").on("click", function() {
|
|
|
|
$(".author__urls").fadeToggle("fast", function() {});
|
|
|
|
$(".author__urls-wrapper button").toggleClass("open");
|
|
|
|
});
|
2016-03-17 20:38:07 +01:00
|
|
|
|
2016-03-10 19:06:17 +01:00
|
|
|
// init smooth scroll
|
|
|
|
$("a").smoothScroll({offset: -20});
|
2016-03-10 03:23:27 +01:00
|
|
|
|
2016-03-10 19:06:17 +01:00
|
|
|
// add lightbox class to all image links
|
|
|
|
$("a[href$='.jpg'],a[href$='.jpeg'],a[href$='.JPG'],a[href$='.png'],a[href$='.gif']").addClass("image-popup");
|
2016-03-10 03:23:27 +01:00
|
|
|
|
2016-03-10 19:06:17 +01:00
|
|
|
// Magnific-Popup options
|
2016-03-10 03:23:27 +01:00
|
|
|
$(".image-popup").magnificPopup({
|
2016-03-10 19:06:17 +01:00
|
|
|
disableOn: function() {
|
|
|
|
if( $(window).width() < 500 ) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
return true;
|
|
|
|
},
|
|
|
|
type: 'image',
|
|
|
|
tLoading: 'Loading image #%curr%...',
|
2013-09-09 16:12:07 +02:00
|
|
|
gallery: {
|
|
|
|
enabled: true,
|
|
|
|
navigateByImgClick: true,
|
2016-03-10 19:06:17 +01:00
|
|
|
preload: [0,1] // Will preload 0 - before current, and 1 after the current image
|
2013-09-09 16:12:07 +02:00
|
|
|
},
|
|
|
|
image: {
|
2016-03-10 19:06:17 +01:00
|
|
|
tError: '<a href="%url%">Image #%curr%</a> could not be loaded.',
|
2013-09-09 16:12:07 +02:00
|
|
|
},
|
2016-03-10 19:06:17 +01:00
|
|
|
removalDelay: 500, // Delay in milliseconds before popup is removed
|
|
|
|
// Class that is added to body when popup is open.
|
|
|
|
// make it unique to apply your CSS animations just to this exact popup
|
|
|
|
mainClass: 'mfp-zoom-in',
|
|
|
|
callbacks: {
|
|
|
|
beforeOpen: function() {
|
|
|
|
// just a hack that adds mfp-anim class to markup
|
|
|
|
this.st.image.markup = this.st.image.markup.replace('mfp-figure', 'mfp-figure mfp-with-anim');
|
|
|
|
}
|
|
|
|
},
|
|
|
|
closeOnContentClick: true,
|
|
|
|
midClick: true // allow opening popup on middle mouse click. Always set it to true if you don't provide alternative source.
|
2013-09-09 16:12:07 +02:00
|
|
|
});
|
2016-03-10 19:06:17 +01:00
|
|
|
|
2016-03-10 03:23:27 +01:00
|
|
|
});
|