Skip to content
This repository has been archived by the owner on Feb 13, 2019. It is now read-only.

extendDOM #155

Merged
merged 3 commits into from Jan 6, 2017
Merged

extendDOM #155

merged 3 commits into from Jan 6, 2017

Conversation

collin
Copy link
Contributor

@collin collin commented Sep 16, 2016

@daytonn @kand @spra85

We need to be able to set properties on the native dom element for our internal react components.

Use case for @jmelvnsn is:

let videoPlayer = document.createElement(`bulbs-video');
videoPlayer.play();

To get that on the dom node, we need this PR and to define:

class BulbsVideo extends BulbsElement {
  /* other metheds truncated */
  play () {
    /* code that plays video */
  }
}

Object.assign(BulbsVideo, {
  extendDOM: {
    play () {
      this.reactInstance.play();
    }
  }
});

This also renames reactComponent to reactInstance as that feels more explicit and correct.

@spra85
Copy link
Contributor

spra85 commented Sep 16, 2016

Seems straightforward. @jmelvnsn are you needing this in order to call play on the <video> element based on what we talked about yesterday for the homepage player? If so, I think we'd also need additional changes to other bulbs-elements, namely I think the <video> element needs to already be on the page underneath the image overlay for it to work as we expect, no?

@collin
Copy link
Contributor Author

collin commented Sep 16, 2016

I think that is correct, the jwplayer will have to be fully initialized and ready to call play on it's <video> element synchronously.

@jmelvnsn
Copy link
Contributor

@spra85 i believe so. what collin said tracks with my expectation

@kand
Copy link
Contributor

kand commented Sep 17, 2016

👍

@collin collin merged commit 6d4dd17 into master Jan 6, 2017
@kand kand deleted the dom-extension branch January 9, 2017 18:31
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants