File: D:/HostingSpaces/SBogers10/rentman.komma.pro/wwwroot/js/customers.js
/**
* Created by Pascal on 30/11/16.
*/
$(function () {
// Detect if throttle and debounce function are init
if (typeof $.throttle === "undefined") rebindThrottleDebounce();
$(window).resize(
$.throttle( 250, resizeCases )
);
resizeCases();
$('.cases .tabs .label').click(function () {
var id = $(this).data('case');
$('.cases .tabs .label').removeClass('active');
$(this).addClass('active');
$('.cases .case.active').removeClass('active');
$('.cases .case[data-case='+id+']').addClass('active');
resizeCases();
});
$('.more-logos .button').click(function () {
// Get how many are visible and add 8
var visible = $(this).data('visible');
visible += 8;
// Update data property
$(this).data('visible', visible);
var amountLogo = $('.customer-logo').length;
// Loop through logos and remove class hidden if it should be visible
$('.customer-logo').each(function (index) {
var length = index + 1;
if(length <= visible) $(this).removeClass('hidden');
});
// If all logos are visible, hide more button
if(visible >= amountLogo) $('.more-logos').addClass('hidden');
});
});
function resizeCases() {
$('.cases .cases-placeholder').height($('.cases .case.active').height());
}