ja.son-williams.ca/www/themes/jason-williamsca/assets/javascript/common.js

26 lines
769 B
JavaScript
Raw Normal View History

$(() => {
// Enable any tooltips on the page
$('[data-toggle="tooltip"]').tooltip()
// Enable masonry layout
$('.masonry').each(function() {
var opts = { itemSelector: '.masonry-item' }
if ($(this).hasClass('masonry-horizontal')) opts.horizontalOrder = true
$(this).masonry(opts)
})
// Resize textareas to fit their content
$('textarea').each(function() {
$(this).height($(this)[0].scrollHeight)
})
// Use google analytics in production
if (!window.location.hostname.includes('dev')) {
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-167178542-1');
}
});