full design completed and small fixes to certain pages to fit the design
3 unresolved threads
3 unresolved threads
Merge request reports
Activity
17 @ViewChild("community", {read: ElementRef}) community: ElementRef; 18 @ViewChild("logIn", {read: ElementRef}) logIn: ElementRef; 19 20 resizeObservable$: Observable<Event> 21 resizeSubscription$: Subscription 22 23 translate: TranslateService; 24 position: string = '0'; 25 width: number = 0; 26 GSWidth: number; 27 mapsWidth: number; 28 communityWidth: number; 29 logInWidth: number; 30 selectedOption: number; 31 32 constructor(public lang: LangService, private router: Router, private cdRef:ChangeDetectorRef) { @Nicolas.Boeckh Pourquoi est-ce qu'on a un wrapper autout du translateService ? On pourrait simplement le rendre directement et tout congiruer au niveau d'app component non ? typiquement propriété
.currentLang
rend certaines implémentations redondantes.Faudra qu'on fasse un code review à l'occasion
Edited by Xoeseko Yao Nyomichanged this line in version 2 of the diff
45 } 46 47 ngAfterViewChecked(): void { 48 this.updateValues(); 49 } 50 51 /** 52 * Method used to update the different widths of the text options 53 */ 54 updateValues(): void{ 55 var updateCheck = this.GSWidth; 56 57 this.GSWidth = this.GS.nativeElement.offsetWidth; 58 this.mapsWidth = this.maps.nativeElement.offsetWidth; 59 this.communityWidth = this.community.nativeElement.offsetWidth; 60 this.logInWidth = this.logIn.nativeElement.offsetWidth; Tous ses appels pourraient être abstraits dans une méthode
getElementWidht(el: ElementRef): number{ return el.nativeElement.offsetWidth; }
Les variables respectives seraient donc inutiles et il y aurait moins de nécéssité de documenter. Tous ceci nous éloigne de notre but de documenter un maximum et de code simple et réutilisable
27 mapsWidth: number; 28 communityWidth: number; 29 logInWidth: number; 30 selectedOption: number; 31 32 constructor(public lang: LangService, private router: Router, private cdRef:ChangeDetectorRef) { 33 this.translate = lang.getTranslateService(); 34 } 35 36 ngOnInit(): void { 37 /** 38 * Detection of window resize event and call to update the highlight line with a small delay 39 * to get accurate values 40 */ 41 this.resizeObservable$ = fromEvent(window, 'resize') 42 this.resizeSubscription$ = this.resizeObservable$.pipe(debounceTime(300)).subscribe( evt => { changed this line in version 2 of the diff
mentioned in commit 846b9e17
Please register or sign in to reply