Dropdown fix

This commit is contained in:
vijikannan 2019-07-23 11:14:08 +05:30
parent 4f9473db6f
commit 4b1613c59f
7 changed files with 21 additions and 22 deletions

View File

@ -20,18 +20,11 @@
<!-- <div class="col-md-3 col-lg-4 text-right"> -->
<div class="col-sm-6 text-right ftr_lng">
<div class="dropdown ftr_dropdown d-inline-block py-2">
<a class="dropdown-toggle" href="#" id="navbarDropdown1" role="button" data-toggle="dropdown"
aria-haspopup="true" aria-expanded="false">
<span class="flag" style="background-image: url('assets/img/uk.jpg')"></span>English
</a>
<div class="dropdown-menu " aria-labelledby="navbarDropdown1">
<a class="dropdown-item p-2" href="#"><span class="flag"
style="background-image: url('assets/img/uk.jpg')"></span>English</a>
<a class="dropdown-item p-2" href="#"><span class="flag"
style="background-image: url('assets/img/german.jpg')"></span>German</a>
</div>
<span class="flag" [ngStyle]="{ 'background-image': 'url(assets/img/' + translate.getCurrentLang() + '.jpg)'}"></span>
<!--<span class="flag" ngIf="translate.getCurrentLang() =='de'" style="background-image: url('assets/img/german.jpg')"></span>-->
<select class="langbut btn btn-outline-primary btn-rounded py-2 ml-2" #langSelect (change)="translate.changeLang(langSelect.value)">
<option *ngFor="let lang of translate.getLanguage()" [value]="lang" [selected]="lang == translate.getCurrentLang()">{{translate.langLabel[lang]}}</option>
</select>
</div>
<button (click)="ChangeTheme()" class="theme_switch btn"><img src="assets/img/dark_theme.webp" height="20" class="light_theme_display"><img src="assets/img/light_theme.webp" height="19" class="dark_theme_display"></button>

View File

@ -14,9 +14,13 @@
</li>
<li class="nav-item dropdown bg-white">
<select class="btn btn-outline-primary btn-rounded text-white py-2 ml-2" #langSelect (change)="translate.changeLang(langSelect.value)">
<option *ngFor="let lang of translate.getLanguage()" [value]="lang" [selected]="lang == translate.getCurrentLang()">{{translate.langLabel[lang]}} ({{ lang }})</option>
<span class="flag " [ngStyle]="{ 'background-image': 'url(assets/img/' + translate.getCurrentLang() + '.jpg)'}"></span>
<!--<span class="flag" ngIf="translate.getCurrentLang() =='de'" style="background-image: url('assets/img/german.jpg')"></span>-->
<select class="langbut btn btn-outline-primary btn-rounded py-2 ml-2" #langSelect (change)="translate.changeLang(langSelect.value)">
<option *ngFor="let lang of translate.getLanguage()" [value]="lang" [selected]="lang == translate.getCurrentLang()">{{translate.langLabel[lang]}}</option>
</select>
</li>
<button (click)="ChangeTheme()" class="theme_switch btn">
<img

View File

@ -17,13 +17,11 @@
</div>
<div class="mble_view_hdr">
<div class="nav-item dropdown bg-white d-inline-block ml-2 order-1 order-sm-2">
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown"
aria-haspopup="true" aria-expanded="false">
<span class="flag" style="background-image: url('assets/img/uk.jpg')"></span>English
</a>
<select class="btn btn-outline-primary btn-rounded text-white py-2 ml-2" #langSelect (change)="translate.changeLang(langSelect.value)">
<option *ngFor="let lang of translate.getLanguage()" [value]="lang" [selected]="lang == translate.getCurrentLang()">{{translate.langLabel[lang]}} ({{ lang }})</option>
</select>
<span class="flag" [ngStyle]="{ 'background-image': 'url(assets/img/' + translate.getCurrentLang() + '.jpg)'}"></span>
<!--<span class="flag" ngIf="translate.getCurrentLang() =='de'" style="background-image: url('assets/img/german.jpg')"></span>-->
<select class="langbut btn btn-outline-primary btn-rounded py-2 ml-2" #langSelect (change)="translate.changeLang(langSelect.value)">
<option *ngFor="let lang of translate.getLanguage()" [value]="lang" [selected]="lang == translate.getCurrentLang()">{{translate.langLabel[lang]}}</option>
</select>
</div>
<button (click)="ChangeTheme()" class="theme_switch mr-2 btn order-2 order-sm-3"><img
src="assets/img/dark_theme.png" height="20" class="light_theme_display"><img

View File

@ -11,7 +11,7 @@ export class TransServiceService{
constructor(public translate : TranslateService,private cookie: CookieService) {
translate.addLangs(['en', 'de']);
translate.setDefaultLang('en');
this.langLabel = {en: 'English', es: 'German'};
this.langLabel = {en: 'English', de: 'German'};
// console.log('this.getCookie() ifconf',this.getCookie() != 'undefined' ? 1: 2);
// console.log("(this.getCookie() && this.getCookie() != null) ? this.getCookie() : (this.getCurrentLang() && this.getCurrentLang() != null) ? this.getCurrentLang() : 'en'",(this.getCookie() && this.getCookie() != 'undefined') ? this.getCookie() : (this.getCurrentLang() && this.getCurrentLang() != 'undefined') ? this.getCurrentLang() : 'en');
translate.use((this.getCookie() && this.getCookie() != 'undefined') ? this.getCookie() : (this.getCurrentLang() && this.getCurrentLang() != 'undefined') ? this.getCurrentLang() : 'en');

View File

@ -603,3 +603,7 @@ body.dark_theme {
min-width: 140px;
margin-right: 10px;
}
.langbut.btn-outline-primary{
border:none !important;
color:rgba(0,0,0,.5);
}

View File

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

Before

Width:  |  Height:  |  Size: 6.6 KiB

After

Width:  |  Height:  |  Size: 6.6 KiB