@@ -170,7 +170,6 @@ export class Service implements IService {
170170 let powerBiElement = < IPowerBiElement > element ;
171171 const component = new Create ( this , powerBiElement , config ) ;
172172 powerBiElement . powerBiEmbed = component ;
173-
174173 this . addOrOverwriteEmbed ( component , element ) ;
175174
176175 return component ;
@@ -266,7 +265,7 @@ export class Service implements IService {
266265 /**
267266 * When loading report after create we want to use existing Iframe to optimize load period
268267 */
269- if ( config . type === "report" && component . config . type === "create" ) {
268+ if ( config . type === "report" && component . config . type === "create" ) {
270269 const report = new Report ( this , element , config , element . powerBiEmbed . iframe ) ;
271270 report . load ( < embed . IInternalEmbedConfiguration > config ) ;
272271 element . powerBiEmbed = report ;
@@ -323,7 +322,7 @@ export class Service implements IService {
323322
324323 addOrOverwriteEmbed ( component : embed . Embed , element : HTMLElement ) : void {
325324 // remove embeds over the same div element.
326- this . embeds = this . embeds . filter ( function ( embed ) {
325+ this . embeds = this . embeds . filter ( function ( embed ) {
327326 return embed . element . id !== element . id ;
328327 } ) ;
329328
@@ -350,11 +349,12 @@ export class Service implements IService {
350349 /** Removes the iframe from the element. */
351350 const iframe = element . querySelector ( 'iframe' ) ;
352351 if ( iframe ) {
353- if ( iframe . remove !== undefined ) {
352+ if ( iframe . remove !== undefined ) {
354353 iframe . remove ( ) ;
355- } else {
356- // workaround for IE: Unhandled rejection TypeError: object doesn't support property or method 'remove'
357- iframe . parentElement . removeChild ( iframe ) ;
354+ }
355+ else {
356+ /** Workaround for IE: unhandled rejection TypeError: object doesn't support propert or method 'remove' */
357+ iframe . parentElement . removeChild ( iframe ) ;
358358 }
359359 }
360360 }
0 commit comments