mirror of
https://github.com/Terncode/pixel.horse.git
synced 2026-09-25 06:05:52 +02:00
Archive commit
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
.btn-group.dropdown(dropdown)
|
||||
button.btn.btn-default.dropdown-toggle(dropdownToggle)
|
||||
| ×{{scale}}
|
||||
.dropdown-menu(*dropdownMenu)
|
||||
a.dropdown-item(*ngFor="let s of scales" (click)="setScale(s)") ×{{s}}
|
||||
@@ -0,0 +1,21 @@
|
||||
import { Component, Input, Output, EventEmitter } from '@angular/core';
|
||||
import { times } from 'lodash';
|
||||
|
||||
@Component({
|
||||
selector: 'scale-picker',
|
||||
templateUrl: 'scale-picker.pug',
|
||||
})
|
||||
export class ScalePicker {
|
||||
@Input() scale = 1;
|
||||
@Output() scaleChange = new EventEmitter<number>();
|
||||
scales = [1, 2, 3, 4];
|
||||
@Input() set maxScale(value: number) {
|
||||
this.scales = times(value, i => i + 1);
|
||||
}
|
||||
setScale(value: number) {
|
||||
if (value !== this.scale) {
|
||||
this.scale = value;
|
||||
this.scaleChange.emit(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user