haught / uiblock

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

uiBlock

A simple javascript based UI blocker to let users know they need to wait for a process to finish while disabling the user's ability to interact with the page. This is useful for Ajax calls that may take some time to process.

Usage: Import uiBlock.js and uiBlock.css into your project.

// add the ui block container and message uiBlock();

// remove the ui block container and message uiUnBlock();

Example:

<script>
    import "uiBlock.js";
    import "uiBlock.css";

    const myAction = (() => {
        uiBlock();
        // ... long running action
        uiUnBlock();
    });
</script>

<button type="button" onClick="myAction()">Action</button>

Example with custom text:

    uiBlock({text: 'Processing...'});

About


Languages

Language:CSS 47.0%Language:JavaScript 28.9%Language:HTML 21.4%Language:Dockerfile 2.7%