Sha256: 5bffefacbe96145dddb8e3c3af76e4d1fe75d2dbea1b3d2c1562a7508b1411f9

Contents?: true

Size: 850 Bytes

Versions: 15

Compression:

Stored size: 850 Bytes

Contents

define ->

  'use strict'

  type: 'Base'

  version: '0.1.0'

  initialize: (options) ->
    names = []

    # TODO access omit method throuhgh underscore
    widget_options =  _.omit options, 'el', 'ref', '_ref', 'name', 'require', 'baseUrl'

    # TODO remove jquery dependency
    for name, suboptions of widget_options when $.type(suboptions) is "object"
      names.push suboptions.name || name
      @add suboptions.name || name, suboptions

    @$el.addClass ['tray', 'widget'].concat(names).join(' ')

    # TODO find a way to build the id based on content
    @$el.attr 'id', options.identifier if options.identifier?

  add: (name, options) ->

    # TODO add widgets as childrens of the tray widget sandbox
    element     = jQuery '<div class="widget"></div>'
    options.el  = element
    @$el.append   element
    @inject name, options

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
ende-0.2.6 lib/assets/javascripts/widgets/tray/main.js.coffee
ende-0.2.5 lib/assets/javascripts/widgets/tray/main.js.coffee
ende-0.2.4 lib/assets/javascripts/widgets/tray/main.js.coffee
ende-0.2.3 lib/assets/javascripts/widgets/tray/main.js.coffee
ende-0.2.2 lib/assets/javascripts/widgets/tray/main.js.coffee
ende-0.2.1 lib/assets/javascripts/widgets/tray/main.js.coffee
ende-0.2.0 lib/assets/javascripts/widgets/tray/main.js.coffee
ende-0.1.14 lib/assets/javascripts/widgets/tray/main.js.coffee
ende-0.1.13 lib/assets/javascripts/widgets/tray/main.js.coffee
ende-0.1.12 lib/assets/javascripts/widgets/tray/main.js.coffee
ende-0.1.11 lib/assets/javascripts/widgets/tray/main.js.coffee
ende-0.1.10 lib/assets/javascripts/widgets/tray/main.js.coffee
ende-0.1.9 lib/assets/javascripts/widgets/tray/main.js.coffee
ende-0.1.8 lib/assets/javascripts/widgets/tray/main.js.coffee
ende-0.1.7 lib/assets/javascripts/widgets/tray/main.js.coffee