set-box-layout.filter.ts
917 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import {Pipe, Inject} from "ng-forward";
import {TranslatorService} from "../../shared/services/translator.service";
@Pipe("setBoxLayout")
@Inject(TranslatorService)
export class SetBoxLayout {
constructor(private translatorService: TranslatorService) { }
transform(pos: number, layout: string) {
console.log(layout)
if(layout == "rightbar") {
return this.right_bar(pos);
}else {
return this.default(pos);
}
}
private default(position: number) {
if(position == 1) {
return "col-md-6 col-md-push-3";
}else if(position == 2){
return "col-md-3 col-md-pull-6";
}else {
return "col-md-3";
}
}
private right_bar(position: number) {
if(position == 1) {
return "col-sm-6 col-sm-push-2";
}else{
return "col-sm-3 col-sm-push-2";
}
}
}