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/helder.komma.pro/resources/assets/js/site/product.js
/* ==========================================================================
 Navigation handler
 ========================================================================== */

/**
 * Main navigation
 */
var Product = {

    // Initialize click event
    init : function()
    {
        $('body.products .order-box .increase').bind('click',function(ev) {
            Product.updateProductValue(1);
            ev.preventDefault();
            return false;
        });
        $('body.products .order-box .decrease').bind('click',function(ev) {
            Product.updateProductValue(-1);
            ev.preventDefault();
            return false;
        });
    },

    updateProductValue : function(update) {
        var el = $('body.products .order-box .amount');
        var amount  = parseInt(el.val());
        if((amount + update) > 0) {
            amount += update;
            el.val(amount);
        }
    }
};

Product.init();