@moodles/processing.js
v1.0.1
Published
A simple jQuery plugin to give buttons a spinner once clicked.
Downloads
3
Readme
Processing.js by Moodles
A simple jQuery plugin to give buttons a spinner once clicked.
Installation
Use with a build process like Webpack:
- Download with npm:
npm install --save @moodles/processing.js - Include
node_modules/@moodles/processing.js/src/processing.jsin your build process (after jQuery).
Manual download:
- Download with npm:
npm install --save processing.jsor clone this repository:git clone [email protected]:MoodlesBV/processing.js.git. - Manually add
/src/processing.jsto your HTML (after jQuery).
Usage
- To enable processing on a button, add the
processingclass. - For custom text besides the spinner, add the
data-processing="custom text here"attribute. - To trigger processing on another element, add the
data-processing-other="selector here"attribute. - Programmatically trigger processing:
// with jQuery (true = start processing, false = stop processing)
$('selector').processing(true/false, 'text');
// manually start processing
startProcessing(element, text);
// manually stop processing
stopProcessing(element);
// check if an element is currently processing
isProcessing(element);