File: spin.jquery.js

package info (click to toggle)
libjs-spin.js 1.2.8%2Bdfsg2-1
  • links: PTS, VCS
  • area: main
  • in suites: buster, stretch
  • size: 88 kB
  • ctags: 19
  • sloc: makefile: 18
file content (17 lines) | stat: -rw-r--r-- 414 bytes parent folder | download | duplicates (10)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// jQuery add-on for allowing spin.js to act on jQuery elements directly.

$.fn.spin = function(opts) {
  this.each(function() {
    var $this = $(this),
        data = $this.data();

    if (data.spinner) {
      data.spinner.stop();
      delete data.spinner;
    }
    if (opts !== false) {
      data.spinner = new Spinner($.extend({color: $this.css('color')}, opts)).spin(this);
    }
  });
  return this;
};