Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enchancement bubble subview events #196

Open
RickButler opened this issue Feb 24, 2018 · 0 comments
Open

Enchancement bubble subview events #196

RickButler opened this issue Feb 24, 2018 · 0 comments

Comments

@RickButler
Copy link
Collaborator

RickButler commented Feb 24, 2018

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'.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant