From d797ccaf772fe13f271a0ba3a7a1b30e3ed7a299 Mon Sep 17 00:00:00 2001 From: Andrzej Jurzak Date: Thu, 16 Mar 2017 11:53:43 +0100 Subject: [PATCH] Code formatting. --- src/service.ts | 26 +++++++++++++------------- tslint.json | 8 ++++---- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/src/service.ts b/src/service.ts index f3c538df..c43a341b 100644 --- a/src/service.ts +++ b/src/service.ts @@ -69,7 +69,7 @@ export class Service implements IService { /** * A list of components that this service can embed */ - private static components: (typeof Report | typeof Tile | typeof Dashboard)[] = [ + private static components: (typeof Report | typeof Tile | typeof Dashboard)[] = [ Tile, Report, Dashboard @@ -170,7 +170,7 @@ export class Service implements IService { let powerBiElement = element; const component = new Create(this, powerBiElement, config); powerBiElement.powerBiEmbed = component; - + this.addOrOverwriteEmbed(component, element); return component; @@ -266,11 +266,11 @@ export class Service implements IService { /** * When loading report after create we want to use existing Iframe to optimize load period */ - if(config.type === "report" && component.config.type === "create") { + if (config.type === "report" && component.config.type === "create") { const report = new Report(this, element, config, element.powerBiEmbed.iframe); report.load(config); element.powerBiEmbed = report; - + this.addOrOverwriteEmbed(component, element); return report; @@ -323,7 +323,7 @@ export class Service implements IService { addOrOverwriteEmbed(component: embed.Embed, element: HTMLElement): void { // remove embeds over the same div element. - this.embeds = this.embeds.filter(function(embed) { + this.embeds = this.embeds.filter(function (embed) { return embed.element.id !== element.id; }); @@ -349,14 +349,14 @@ export class Service implements IService { delete powerBiElement.powerBiEmbed; /** Removes the iframe from the element. */ const iframe = element.querySelector('iframe'); - if (iframe) { - if (iframe.remove !== undefined) { - iframe.remove(); - } else { - // workaround for IE: Unhandled rejection TypeError: object doesn't support property or method 'remove' - iframe.parentElement.removeChild(iframe); - } - } + if (iframe) { + if (iframe.remove !== undefined) { + iframe.remove(); + } else { + // workaround for IE: Unhandled rejection TypeError: object doesn't support property or method 'remove' + iframe.parentElement.removeChild(iframe); + } + } } /** diff --git a/tslint.json b/tslint.json index 5235b53e..76cfa585 100644 --- a/tslint.json +++ b/tslint.json @@ -1,9 +1,9 @@ { "extends": "tslint:recommended", "rules": { - "max-line-length": false, + "max-line-length": [false], "member-access": false, - "no-console": false, + "no-console": [false], "one-line": [ "check-whitespace", "check-open-brace" @@ -12,13 +12,13 @@ "single", "avoid-escape" ], - "trailing-comma": false, + "trailing-comma": [false], "whitespace": [ "check-branch", "check-decl", "check-operator", "check-module", - "check-seperator", + "check-separator", "check-type" ], "object-literal-sort-keys": false