Skip to content

overwrite component in embeds array if it existed before. - #148

Merged
ali-hamud merged 1 commit into
devfrom
alihamud_multiple_embeds_bug
Feb 22, 2017
Merged

ali-hamud merged 1 commit into
devfrom
alihamud_multiple_embeds_bug

Conversation

@ali-hamud

Copy link
Copy Markdown
Contributor

We should not maintain two embed components on the same div element.

Comment thread src/service.ts

addOrOverwriteEmbed(component: embed.Embed, element: HTMLElement): void {
// remove embeds over the same div element.
this.embeds = this.embeds.filter(function(embed) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why aren't you removing the identical component before re-appending it? Each embed.load( will leave an orphaned component?

@ali-hamud
ali-hamud merged commit 9cd4e41 into dev Feb 22, 2017
@ali-hamud
ali-hamud deleted the alihamud_multiple_embeds_bug branch February 22, 2017 08:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants