Permalink
Browse files

some minor syntax and coding style changes

  • Loading branch information...
1 parent 47d6cd2 commit 11fac0f940d083eda9f233748156da998608c81f @ephaee ephaee committed Aug 28, 2010
Showing with 13 additions and 13 deletions.
  1. +5 −5 Demos/demo.js
  2. +1 −1 Docs/Loop.md
  3. +7 −7 Source/Loop.js
View
@@ -18,23 +18,23 @@ var LoopTest = new Class({
});
-window.addEvent('domready',function(){
+window.addEvent('domready', function(){
loop = new LoopTest('log');
- $('start').addEvent('click',function(){
+ $('start').addEvent('click', function(){
loop.startLoop();
});
- $('stop').addEvent('click',function(){
+ $('stop').addEvent('click', function(){
loop.stopLoop();
});
- $('reset').addEvent('click',function(){
+ $('reset').addEvent('click', function(){
loop.resetLoop();
});
- $('restart').addEvent('click',function(){
+ $('restart').addEvent('click', function(){
($('up').checked) ?
loop.setLoop(loop.up, $('delay').value) :
loop.setLoop(loop.down, $('delay').value);
View
@@ -40,7 +40,7 @@ Useful in galleries, slideshows, tickers, sprite animations, pulsing, logout scr
},
update: function(count){
- this.log.set('text',"Looped " + count + " times");
+ this.log.set('text', "Looped " + count + " times");
}
});
View
@@ -28,32 +28,32 @@ var Loop = new Class({
isLooping: false,
loopMethod: $empty,
- setLoop: function(fn,delay){
- if(this.isLooping) {
+ setLoop: function(fn, delay){
+ if (this.isLooping){
this.stopLoop();
var wasLooping = true;
} else {
var wasLooping = false;
}
this.loopMethod = fn;
this.loopDelay = delay || 3000;
- if(wasLooping) this.startLoop();
+ if (wasLooping) this.startLoop();
return this;
},
- stopLoop: function() {
+ stopLoop: function(){
this.isStopped = true;
this.isLooping = false;
$clear(this.periodical);
return this;
},
- startLoop: function(delay) {
- if(this.isStopped){
+ startLoop: function(delay){
+ if (this.isStopped){
var delay = (delay) ? delay : this.loopDelay;
this.isStopped = false;
this.isLooping = true;
- this.periodical = this.looper.periodical(delay,this);
+ this.periodical = this.looper.periodical(delay, this);
};
return this;
},

0 comments on commit 11fac0f

Please sign in to comment.