// @package     CPV Lab Pro
// @copyright   (C) Uptechvision Solutions. All rights reserved.
// @link        https://cpvlab.pro

$(document).ready(function(){
	initializeTooltips();
	initializePopovers();
    setTimeout(function(){
        $('.alert > button.close.autoclose:visible').parent().fadeOut();
    }, 2500);
    window.alert = function(message) {
        $('#modal-alert .content').text(message);
        $('#modal-alert').modal();
    };
    window.confirm = function(message, callback) {
        $('#modal-confirm-yes').off();
        $('#modal-confirm .content').text(message);
        $('#modal-confirm').modal();
        $('#modal-confirm-yes').click(function() {
            if (typeof callback != 'undefined') {
                $('#modal-confirm').modal('hide');
                callback();
            } else {
                console.log('provide callback as 2nd param to confirm() function (customized confirm())');
            }
        });
        return false;
    };
});
