Skip to content

Enchancement bubble subview events #196

@RickButler

Description

@RickButler

I would like to propose an enhancement that I will develop to provide opt-in event bubbling for sub-views.
This gives event bubbling for sub-views, something which i know has been asked for before, with an opt in strategy so the we don't end up with adverse impact from listening to too many events.

subview: {
  mysubView: {
    bubbleEvents: 'change:render change:myValue',
    prepareview: function (el) {
      return new View({ el: el});
    }
  }
}
subview: {
  mysubView: {
    bubbleEvents: true, // or 'all'
    prepareview: function (el) {
      return new View({ el: el});
    }
  }
}

It will probably add a conditional call to
this.listenTo(subview, subview.bubbleEvents, this._getCachedEventBubblingHandler(subview));
inside _parseSubview, and may need some logic inside _parseSubviewOpts to turn truthy values into 'all'.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions