mirror of
				https://github.com/flynx/PortableMag.git
				synced 2025-11-04 05:50:19 +00:00 
			
		
		
		
	
		
			
	
	
		
			17 lines
		
	
	
		
			405 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
		
		
			
		
	
	
			17 lines
		
	
	
		
			405 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
| 
								 | 
							
								// taken from: http://fgnass.github.com/spin.js/ 
							 | 
						||
| 
								 | 
							
								$.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;
							 | 
						||
| 
								 | 
							
								};
							 |