Sha256: 30ce3f84658acfa373a1932aaf94c30d097b8888f01a4a613ddb45e7cf385c12

Contents?: true

Size: 1.03 KB

Versions: 4

Compression:

Stored size: 1.03 KB

Contents

module ProgressbarHelper
    
	def p_progressbar(id,options={})    
    output = progressbar_encode_markup(id,options)  
    output += progressbar_encode_script(id,options)              		                        
	end	
	
	protected
	
	def progressbar_encode_markup(id,options={})
    clientid = sanitize_to_id(id)	
		options = options.stringify_keys   
    options = options.merge(:id => clientid)                         		     
    content_tag(:div,nil, options)        		
	end
	
	def progressbar_encode_script(id,options={})
    options = options.stringify_keys
    clientid = sanitize_to_id(id)
    widgetvar = options.has_key?("widgetVar") ? options["widgetVar"] : "widget_"+clientid		
    options_ui = options
    options_ui = options_ui.merge(:id => clientid)                         
    options_ui = options_ui.to_json        
        
    script = '$(function() {'
    script += "PrimeFaces.cw('Progressbar','#{widgetvar}',#{options_ui})"
    script += '});'         
    p_javascript_tag(script, "id" => clientid+"_s")        		
	end
	
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
prime-rails-0.0.16 app/helpers/progressbar_helper.rb
prime-rails-0.0.15 app/helpers/progressbar_helper.rb
prime-rails-0.0.14 app/helpers/progressbar_helper.rb
prime-rails-0.0.13 app/helpers/progressbar_helper.rb