NG1NDEX
Server IP : 150.95.80.236  /  Your IP : 18.218.189.173
Web Server : Apache
System : Linux host-150-95-80-236 3.10.0-1160.105.1.el7.x86_64 #1 SMP Thu Dec 7 15:39:45 UTC 2023 x86_64
User : social-telecare ( 10000)
PHP Version : 7.4.33
Disable Function : opcache_get_status
MySQL : OFF  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /var/www/vhosts/pcu.in.th/uat.pcu.in.th/demo15/src/js/custom/documentation/base/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME SHELL ]     

Current File : /var/www/vhosts/pcu.in.th/uat.pcu.in.th/demo15/src/js/custom/documentation/base/toasts.js
"use strict";

// Class definition
const KTBaseToastDemos = function () {
    // Private functions
    const exampleToggle = () => {
        // Select elements
        const button = document.getElementById('kt_docs_toast_toggle_button');
        const toastElement = document.getElementById('kt_docs_toast_toggle');

        // Get toast instance --- more info: https://getbootstrap.com/docs/5.1/components/toasts/#getinstance
        const toast = bootstrap.Toast.getOrCreateInstance(toastElement);

        // Handle button click
        button.addEventListener('click', e => {
            e.preventDefault();

            // Toggle toast to show --- more info: https://getbootstrap.com/docs/5.1/components/toasts/#show
            toast.show();
        });
    }

    const exampleStack = () => {
        // Select elements
        const button = document.getElementById('kt_docs_toast_stack_button');
        const container = document.getElementById('kt_docs_toast_stack_container');
        const targetElement = document.querySelector('[data-kt-docs-toast="stack"]'); // Use CSS class or HTML attr to avoid duplicating ids

        // Remove base element markup
        targetElement.parentNode.removeChild(targetElement);

        // Handle button click
        button.addEventListener('click', e => {
            e.preventDefault();

            // Create new toast element
            const newToast = targetElement.cloneNode(true);
            container.append(newToast);

            // Create new toast instance --- more info: https://getbootstrap.com/docs/5.1/components/toasts/#getorcreateinstance
            const toast = bootstrap.Toast.getOrCreateInstance(newToast);

            // Toggle toast to show --- more info: https://getbootstrap.com/docs/5.1/components/toasts/#show
            toast.show();
        });
    }

    return {
        // Public Functions
        init: function () {
            exampleToggle();
            exampleStack();
        }
    };
}();

// On document ready
KTUtil.onDOMContentLoaded(function () {
    KTBaseToastDemos.init();
});

Anon7 - 2022
AnonSec Team