Sha256: de94ad0b1e72580614ddf9a01ef633fcff33608f88df389809391ed3c8e84ece
Contents?: true
Size: 763 Bytes
Versions: 12
Compression:
Stored size: 763 Bytes
Contents
module Erector module JQuery # Emits a jQuery script, inside its own script tag, that is to be run on document ready or load. # # Usage (from inside a widget method): # jquery "alert('hi')" :: a jquery ready handler # jquery "alert('hi')", :id => 'foo' :: a jquery ready handler, with attributes in the script tag # jquery :load, "alert('hi')" :: a jquery load handler # def jquery(*args) event = if args.first.is_a? Symbol args.shift else :ready end txt = args.shift attributes = args.shift || {} javascript attributes do rawtext "\n" rawtext "jQuery(document).#{event}(function($){\n" rawtext txt rawtext "\n});" end end end end
Version data entries
12 entries across 12 versions & 1 rubygems