Sha256: e6f07fc311fd46fa43ef8de7adad3fb2561174a9ea03424fee1c2edc340a0b80
Contents?: true
Size: 1.02 KB
Versions: 25
Compression:
Stored size: 1.02 KB
Contents
define -> 'use strict' type: 'Base' version: '0.1.2' initialize: (options) -> names = [] {identifier} = options # TODO access omit method throuhgh underscore widget_options = _.omit options, 'el', 'ref', '_ref', 'name', 'require', 'baseUrl', 'resource' # 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(' ') @identifier ||= identifier # TODO find a way to build the id based on content if identifier? @identifier = identifier @$el.attr 'id', identifier @sandbox.start() add: (name, options) -> # TODO add widgets as childrens of the tray widget sandbox # TODO remove jquery dependency, and use documentFragment to build widgets element = jQuery '<div class="widget"></div>' options.el = element @$el.append element @inject name, options
Version data entries
25 entries across 25 versions & 1 rubygems