Skip to content

Commit

Permalink
Code formatting.
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrzej Jurzak committed Mar 16, 2017
1 parent 531ef43 commit d797cca
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 17 deletions.
26 changes: 13 additions & 13 deletions src/service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -170,7 +170,7 @@ export class Service implements IService {
let powerBiElement = <IPowerBiElement>element;
const component = new Create(this, powerBiElement, config);
powerBiElement.powerBiEmbed = component;

this.addOrOverwriteEmbed(component, element);

return component;
Expand Down Expand Up @@ -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(<embed.IInternalEmbedConfiguration>config);
element.powerBiEmbed = report;

this.addOrOverwriteEmbed(component, element);

return report;
Expand Down Expand Up @@ -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;
});

Expand All @@ -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);
}
}
}

/**
Expand Down
8 changes: 4 additions & 4 deletions tslint.json
Original file line number Diff line number Diff line change
@@ -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"
Expand All @@ -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
Expand Down

0 comments on commit d797cca

Please sign in to comment.