summaryrefslogtreecommitdiff
path: root/xstatic/pkg/spin/data/spin.jquery.js
diff options
context:
space:
mode:
Diffstat (limited to 'xstatic/pkg/spin/data/spin.jquery.js')
-rw-r--r--xstatic/pkg/spin/data/spin.jquery.js17
1 files changed, 17 insertions, 0 deletions
diff --git a/xstatic/pkg/spin/data/spin.jquery.js b/xstatic/pkg/spin/data/spin.jquery.js
new file mode 100644
index 0000000..14975d0
--- /dev/null
+++ b/xstatic/pkg/spin/data/spin.jquery.js
@@ -0,0 +1,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;
+};