Sha256: 28e82171f0a78af6d4f359dcfee5849f39118b6dc79edca9f891d86483f18167
Contents?: true
Size: 1.11 KB
Versions: 28
Compression:
Stored size: 1.11 KB
Contents
class IuguUI.Radio defaults: none: false el: undefined @load: ( context ) -> selector = "[data-type='iux.form.radio']" if context elements = context.find(selector) else elements = $(selector) return if elements.length == 0 elements.each -> return if $(@).data("iux.initialized") == true new IuguUI.Radio el: @ $(@).data "iux.initialized", true constructor: ( options ) -> @initialize( options ) initialize: ( options ) -> _.bindAll @ @options = _.extend {}, @defaults, options return null unless @options.el @el = $(@options.el) if @options.el radio_classes = "radio" @decorator = $('<a>', class: radio_classes + ( if @el.is(":checked") then ' selected' else '') html: '<div class="outer_decorator"><div class="inner_decorator"></div></div>' "data-mode": "toggle" "data-input": @el.attr("id") "data-group": @el.attr("name") ) @decorator.insertAfter( @el ) new IuguUI.Button el: @decorator context: @el @IuguUI.Radio = IuguUI.Radio $ -> IuguUI.Radio.load()
Version data entries
28 entries across 28 versions & 1 rubygems