enable prefer-const rule for tslint, fix issues (#4409)

* enable prefer-const rule for tslint, fix issues

* Update content-node-selector.component.spec.ts

* Update content-node-selector.component.spec.ts

* fix const

* fix lint issues

* update tests

* update tests

* update tests

* fix code

* fix page class
This commit is contained in:
Denys Vuika
2019-03-25 12:19:33 +00:00
committed by Eugenio Romano
parent 26c5982a1a
commit a7a48e8b2b
581 changed files with 5435 additions and 5402 deletions

View File

@@ -58,14 +58,14 @@ export class RaphaelMultilineTextDirective extends RaphaelBase implements OnInit
}
draw(position: Point, text: string) {
let textPaper = this.paper.text(position.x + this.TEXT_PADDING, position.y + this.TEXT_PADDING, text).attr({
const textPaper = this.paper.text(position.x + this.TEXT_PADDING, position.y + this.TEXT_PADDING, text).attr({
'text-anchor': 'middle',
'font-family': 'Arial',
'font-size': '11',
'fill': '#373e48'
});
let formattedText = this.formatText(textPaper, text, this.elementWidth);
const formattedText = this.formatText(textPaper, text, this.elementWidth);
textPaper.attr({
'text': formattedText
});
@@ -74,17 +74,18 @@ export class RaphaelMultilineTextDirective extends RaphaelBase implements OnInit
}
private formatText(textPaper, text, elementWidth) {
let pText = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
const pText = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
textPaper.attr({
'text': pText
});
let letterWidth = textPaper.getBBox().width / text.length;
let removedLineBreaks = text.split('\n');
let actualRowLength = 0, formattedText = [];
const letterWidth = textPaper.getBBox().width / text.length;
const removedLineBreaks = text.split('\n');
let actualRowLength = 0;
const formattedText = [];
removedLineBreaks.forEach((sentence) => {
let words = sentence.split(' ');
const words = sentence.split(' ');
words.forEach((word) => {
let length = word.length;
const length = word.length;
if (actualRowLength + (length * letterWidth) > elementWidth) {
formattedText.push('\n');
actualRowLength = 0;