Comparing version 0.1.5 to 0.1.8
@@ -6,4 +6,8 @@ module.exports = function() { | ||
* | ||
* Depends on the `class` plugin. | ||
* Dependencies: | ||
* | ||
* * air/attr | ||
* * air/class | ||
* * air/hidden | ||
* | ||
* @param opts The options. | ||
@@ -15,10 +19,16 @@ */ | ||
} | ||
opts = opts || {}; | ||
opts.wait = opts.wait !== undefined ? opts.wait : 10; | ||
opts.delay = opts.delay || 1000; | ||
opts.wait = opts.wait !== undefined ? opts.wait : 0; | ||
opts.delay = opts.delay || 500; | ||
opts.begin = opts.begin || 'animated'; | ||
if(opts.infinite) { | ||
opts.begin += ' infinite'; | ||
} | ||
cb = cb || function noop(){}; | ||
cb = cb.bind(this); | ||
console.log(opts); | ||
//console.log(opts); | ||
@@ -33,6 +43,7 @@ this.removeClass(opts.begin); | ||
function start() { | ||
var start = function start() { | ||
// must have loaded the air/hidden plugin | ||
if(opts.show) { | ||
this.attr('hidden', null); | ||
this.show(); | ||
} | ||
@@ -42,7 +53,9 @@ | ||
setTimeout(stop, opts.delay); | ||
} | ||
}.bind(this); | ||
var stop = function stop() { | ||
this.removeClass(opts.start); | ||
this.removeClass(opts.begin); | ||
if(!opts.infinite) { | ||
this.removeClass(opts.start); | ||
this.removeClass(opts.begin); | ||
} | ||
@@ -60,3 +73,3 @@ if(opts.pause) { | ||
if(opts.wait) { | ||
setTimeout(start.bind(this), opts.wait); | ||
setTimeout(start, opts.wait); | ||
}else{ | ||
@@ -63,0 +76,0 @@ start(); |
@@ -18,2 +18,4 @@ module.exports = function() { | ||
this.flash = flash; | ||
//console.log('flash: ' + this.flash); | ||
} |
{ | ||
"name": "vivify", | ||
"version": "0.1.5", | ||
"version": "0.1.8", | ||
"description": "Animation plugins", | ||
@@ -13,3 +13,3 @@ "author": "muji <noop@xpm.io>", | ||
"devDependencies": { | ||
"air": "~0.1.13", | ||
"air": "~0.2.1", | ||
"brfs": "~1.4.0", | ||
@@ -16,0 +16,0 @@ "browserify": "~9.0.3", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
8099
129