HEX
Server: Microsoft-IIS/8.5
System: Windows NT YDAWBH120 6.3 build 9600 (Windows Server 2012 R2 Standard Edition) AMD64
User: tentjecom_web (0)
PHP: 7.4.14
Disabled: NONE
Upload Files
File: D:/HostingSpaces/SBogers10/kms.komma.pro/wwwroot/public/js/basic_page.js
// Objects
var $switch = $('.switch');
var $info = $('.info');
var $file_bar = $('.file_bar');

// Call init
initPage();

function initPage()
{
    // Make an AJAX call when clicked on switch
    handleSwitch();

    // Make sure planes are the right height
    preparePlanes();

    // Create a scroll bar on the planes
    initScrollPane($info);
    initScrollPane($file_bar);
}

/*
 * Make an AJAX call when clicked on switch
 */
function handleSwitch()
{
    $switch.click(function()
    {
        $(this).toggleClass('on');
    });
}

/*
 * Prepare planes for resizing
 */
function preparePlanes()
{
    // Call resize function once and on window-resize
    $window.resize(resizePlanes);
    resizePlanes();
}

/*
 * Resize planes
 */
function resizePlanes()
{
    var $planes = $('#item .info,#item .file_bar')
    if($planes.size() > 0)
    {
        var h = $window.height() - $planes.offset().top;
        $planes.height(h);
    }
}