budoco icon indicating copy to clipboard operation
budoco copied to clipboard

for ajax posts, like run sql and file upload, revise how we do user feedback.

Open ctrager opened this issue 4 years ago • 8 comments

This works real bad on demo site

ctrager avatar Dec 08 '20 22:12 ctrager

Maybe a simple loader panel?

ghost avatar Dec 09 '20 00:12 ghost

I don't know what that means.

ctrager avatar Dec 09 '20 00:12 ctrager

On start ajax request block UI.

https://stackoverflow.com/questions/1964839/how-can-i-create-a-please-wait-loading-animation-using-jquery

ghost avatar Dec 09 '20 00:12 ghost

I did something simple and it's sufficient.

ctrager avatar Dec 09 '20 01:12 ctrager

To site.js file.

$(function () {
    var $document = $(document);
    var $loader = $("<div class='loader' style='position: absolute; width: 100%; height: 100%; z-index: 100; top: 0;background: rgba(0, 0, 0, 0.5);display: flex;align-items: center;justify-content: center;color: #fff;'><div>Please wait...</div><div>")

    $document.ajaxStart(function () {
        $loader.appendTo(document.body);
    });

    $document.ajaxStop(function () {
        $loader.remove();
    });
});

ghost avatar Dec 09 '20 01:12 ghost

Thanks for explaining. I like that better than what I did. I'll revisit.

ctrager avatar Dec 09 '20 01:12 ctrager

position: absolute; to position: fixed; for work with scrolling No needs call methods directly.

ghost avatar Dec 09 '20 01:12 ghost

👍

ghost avatar Dec 09 '20 01:12 ghost