Merge pull request #923 from theodorejb/update-spin.js-definition

Updated spin.js definition for v1.3.1 of the library
This commit is contained in:
Boris Yankov
2013-08-24 12:53:10 -07:00
2 changed files with 33 additions and 11 deletions
+24 -2
View File
@@ -4,5 +4,27 @@ var spinner = new Spinner().spin();
target.appendChild(spinner.el);
var target = document.getElementById('foo');
var opts = { speed: 5, className: 'awesome' };
var spinner2 = new Spinner(opts).spin(target);
var opts = { speed: 5, color: '#abcdef' };
var spinner2 = new Spinner(opts).spin(target);
var opts2 = {
lines: 10,
length: 20,
width: 7,
radius: 14,
corners: 0.6,
rotate: 0,
direction: 1,
color: ['#aaa', '#fedcba', '#fff', '#aef02b'],
speed: 1.5,
trail: 50,
shadow: true,
hwaccel: true,
className: 'spinner',
zIndex: 5,
top: '28',
left: 'auto'
};
var newTarget = document.getElementById('bar');
var spinner3 = new Spinner(opts2).spin(newTarget);
+9 -9
View File
@@ -1,4 +1,4 @@
// Type definitions for Spin.js 1.3
// Type definitions for Spin.js 1.3.1
// Project: http://fgnass.github.com/spin.js/
// Definitions by: Boris Yankov <https://github.com/borisyankov/> and Theodore Brown <https://github.com/theodorejb/>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
@@ -12,7 +12,7 @@ interface SpinnerOptions {
corners?: number; // Corner roundness (0..1)
rotate?: number; // The rotation offset
direction?: number; // 1: clockwise, -1: counterclockwise
color?: string; // #rgb or #rrggbb
color?: any; // #rgb or #rrggbb or array of colors
speed?: number; // Rounds per second
trail?: number; // Afterglow percentage
shadow?: boolean; // Whether to render a shadow
@@ -29,16 +29,16 @@ declare class Spinner {
public el: HTMLElement;
constructor(options?: SpinnerOptions);
/**
* Adds the spinner to the given target element. If this instance is already
* spinning, it is automatically removed from its previous target by calling
* stop() internally.
/**
* Adds the spinner to the given target element. If this instance is already
* spinning, it is automatically removed from its previous target by calling
* stop() internally.
*/
spin(target?: any): Spinner;
/**
* Stops and removes the Spinner.
* Stopped spinners may be reused by calling spin() again.
/**
* Stops and removes the Spinner.
* Stopped spinners may be reused by calling spin() again.
*/
stop(): Spinner;
lines(el, o);