progress.js icon indicating copy to clipboard operation
progress.js copied to clipboard

Suggestion: autoRemove don't remove, just stops.

Open hgc2002 opened this issue 10 years ago • 0 comments

autoRemove does more than just removing. It does the internal timer cleaning. But what about doing the cleaning but letting the bar visible (i.e. do not remove it),.

I did this very simple: add a property like justStop, set it as true and add this code:

function remove(callback) {
    window.clearInterval(intervals['backgroundAnimation']);

    //hgc 1-oct-2015
    //this way the bar will stay but animation will stop consuming resources.
    if (config.justStop) return;

    var renderedProgressBar = document.getElementById(config.id);
    renderedProgressBar.parentNode.removeChild(renderedProgressBar);
}

hgc2002 avatar Oct 01 '15 22:10 hgc2002