more refactor

This commit is contained in:
Andras Schmelczer 2019-09-06 23:16:05 +02:00
commit d612678682
3 changed files with 36 additions and 52 deletions

View file

@ -9,14 +9,13 @@ import { Page } from '../../../../model/page';
styleUrls: ['./settings.component.scss']
})
export class SettingsComponent implements OnInit {
page: Page;
constructor(public modalService: ModalService, public dataService: DataService) {}
ngOnInit() {
this.modalService.active.input.subscribe(p => (this.page = p));
}
page: Page;
async deletePage() {
try {
await this.modalService.showRemovePage(this.page.name);

View file

@ -41,7 +41,7 @@ export class TowerComponent implements OnInit {
this.blocks = value.coloredBlocks
.filter(b => b.isDone)
.map(b => {
let classedBlock = b as StyledBlock;
const classedBlock = b as StyledBlock;
classedBlock.shouldDraw = true;
classedBlock.style = { transform: 'translateY(0)', opacity: '1' };
classedBlock.cssClass = '';
@ -52,7 +52,7 @@ export class TowerComponent implements OnInit {
console.log(this.tower, this.tower.latestVersion, value);
}
if (this.tower && this.tower.latestVersion === value) {
let difference = this.tower.blocks.map((b, index) => {
const difference = this.tower.blocks.map((b, index) => {
return b === value.blocks[index];
});

View file

@ -93,7 +93,7 @@ export class DoubleSliderComponent {
}
private emitValue() {
const range = {
this.range.emit({
from:
this.oneValue < this.otherValue
? this.values[this.indexFromValue(this.oneValue)]
@ -102,7 +102,6 @@ export class DoubleSliderComponent {
this.oneValue < this.otherValue
? this.values[this.indexFromValue(this.otherValue)]
: this.values[this.indexFromValue(this.oneValue)]
};
this.range.emit(range);
});
}
}