1.0.1 • Published 7 years ago

@moodles/processing.js v1.0.1

Weekly downloads
1
License
ISC
Repository
github
Last release
7 years ago

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.js in your build process (after jQuery).

Manual download:

  • Download with npm: npm install --save processing.js or clone this repository: git clone git@github.com:MoodlesBV/processing.js.git.
  • Manually add /src/processing.js to your HTML (after jQuery).

Usage

  • To enable processing on a button, add the processing class.
  • 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);