Loading lock component.
HTML JavaScript CSS Makefile
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
examples
.gitignore
History.md
Makefile
Readme.md
component.json
index.js
loading-lock.css
package.json

Readme.md

loading-lock

Loading lock component. Locks element while loading and adds spinner with component/spin.

Installation

$ component install cristiandouce/loading-lock

API

  var loading = require('loading-lock');

loading(el, options)

Returns a LoadingLock instance for given element with options. Valid options are:

  • size: Size (Number) diameter of loading spinner.
  var locker = loading(document.getElementById('example'), { size: 80 });

.lock()

Locks element adding 'locked' class and spinner.

  locker.lock();

.unlock()

Unlocks element removing 'locked' class and spinner.

  locker.unlock();

License

MIT