Sha256: 949b22d5765b41c1ab8026fef3cad0d296a747362ad9e7b816770d5283825cc7

Contents?: true

Size: 1.33 KB

Versions: 29

Compression:

Stored size: 1.33 KB

Contents

// CytoField v0.1
// By MacKinley Smith
(function($){
	var defaults = {
		widget:{
			field:{
				
			}
		},
		events:{
			create:function(cy){},
			change:function(cy,event){},
			destroy:function(cy){}
		}
	};
	
	var methods = {
		init:function(options){
			return this.each(function(){
				var $this = $(this);
				var settings = $.extend(true,{},defaults,options);
				
				// Setup widget
				
				
				$this.data('cytoField',settings);
				methods.resize.apply($this);
			});
		},
		resize:function(){
			return this.each(function(){
				var $this = $(this);
				var settings = $this.data('cytoField');
				if (settings==null) return console.warn("You must instantiate $.cytoField before you call the resize method!");
				$this.width("100%");
				setTimeout(function(){
					$this.width($this.width()-16);
				},1);
			});
		},
		destroy:function(){
			return this.each(function(){
				
			});
		}
	};
	
	$.fn.cytoField=function(method){
		if (methods[method]) return methods[method].apply(this,Array.prototype.slice.call(arguments,1));
		else if (typeof method == 'object' || !method) return methods.init.apply(this,arguments);
		else $.error('Method ' + method + ' does not exist on $.cytoField!');
	};
	
	$(window).resize(function(){$('.cytoField').cytoField('resize');});
	$.Cytoplasm("ready",function(){$('.cytoField').cytoField();});
})(jQuery);

Version data entries

29 entries across 29 versions & 1 rubygems

Version Path
cytoplasm-0.3.5 app/assets/javascripts/cytoplasm/cytoField.js.erb
cytoplasm-0.3.4 app/assets/javascripts/cytoplasm/cytoField.js.erb
cytoplasm-0.3.3 app/assets/javascripts/cytoplasm/cytoField.js.erb
cytoplasm-0.3.1 app/assets/javascripts/cytoplasm/cytoField.js.erb
cytoplasm-0.3.0 app/assets/javascripts/cytoplasm/cytoField.js.erb
cytoplasm-0.2.9 app/assets/javascripts/cytoplasm/cytoField.js.erb
cytoplasm-0.2.8 app/assets/javascripts/cytoplasm/cytoField.js.erb
cytoplasm-0.2.7 app/assets/javascripts/cytoplasm/cytoField.js.erb
cytoplasm-0.2.6 app/assets/javascripts/cytoplasm/cytoField.js.erb
cytoplasm-0.2.5 app/assets/javascripts/cytoplasm/cytoField.js.erb
cytoplasm-0.2.4 app/assets/javascripts/cytoplasm/cytoField.js.erb
cytoplasm-0.2.3 app/assets/javascripts/cytoplasm/cytoField.js.erb
cytoplasm-0.2.2 app/assets/javascripts/cytoplasm/cytoField.js.erb
cytoplasm-0.2.1 app/assets/javascripts/cytoplasm/cytoField.js.erb
cytoplasm-0.2.0 app/assets/javascripts/cytoplasm/cytoField.js.erb
cytoplasm-0.1.9 app/assets/javascripts/cytoplasm/cytoField.js.erb
cytoplasm-0.1.8 app/assets/javascripts/cytoplasm/cytoField.js.erb
cytoplasm-0.1.7 app/assets/javascripts/cytoplasm/cytoField.js.erb
cytoplasm-0.1.6 app/assets/javascripts/cytoplasm/cytoField.js.erb
cytoplasm-0.1.5 app/assets/javascripts/cytoplasm/cytoField.js.erb