Sha256: 61602cd2f325a1654f6e0cf25fb5409769793564491e75790f5c12b983200502

Contents?: true

Size: 785 Bytes

Versions: 1

Compression:

Stored size: 785 Bytes

Contents

#= require ./base

class Ultimate.Backbone.View extends Backbone.View

# Mixins support
  @include: (mixin) ->
    unless mixin?
      throw new Error('Mixin is undefined')
    _.extend @::, mixin

  __super: (methodName, args) ->
    obj = @
    calledMethod = @[methodName]
    obj = obj.constructor.__super__  while obj[methodName] is calledMethod
    superMethod = obj[methodName]
    unless superMethod?
      throw new Error("__super can't find super method '#{methodName}'")
    superMethod.apply @, args

  # Overload parent method Backbone.View._configure() as hook for reflectOptions()
  _configure: (options) ->
    super
    @reflectOptions()

  reflectOptions: (options = @options) ->
    @[attr] = value  for attr, value of options  when not _.isUndefined(@[attr])
    @

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ultimate-base-0.6.0 app/assets/javascripts/ultimate/backbone/view.js.coffee