Skip to content
Snippets Groups Projects
Commit 4e809146 authored by Daviti Gogshelidze's avatar Daviti Gogshelidze
Browse files

Remove isMobile and darktheme dependencies plus mobile menu style

parent c49003f7
No related branches found
No related tags found
No related merge requests found
...@@ -22,9 +22,6 @@ export class DropdownComponent{ ...@@ -22,9 +22,6 @@ export class DropdownComponent{
@Input() listDisplay : (obj:any)=>string = (obj)=>obj.name @Input() listDisplay : (obj:any)=>string = (obj)=>obj.name
@Input() activeDisplay : (obj:any|null)=>string = (obj)=>obj ? obj.name : `Please select an item.` @Input() activeDisplay : (obj:any|null)=>string = (obj)=>obj ? obj.name : `Please select an item.`
@Input() isMobile: boolean
@Input() darktheme: boolean
@Output() itemSelected : EventEmitter<any> = new EventEmitter() @Output() itemSelected : EventEmitter<any> = new EventEmitter()
@Output() listItemButtonClicked: EventEmitter<any> = new EventEmitter() @Output() listItemButtonClicked: EventEmitter<any> = new EventEmitter()
......
...@@ -56,3 +56,21 @@ radio-list ...@@ -56,3 +56,21 @@ radio-list
overflow-x:hidden; overflow-x:hidden;
display:block; display:block;
} }
.dropdownTitle {
border: 1px solid !important;
}
.dropdownTitleOpen {
border: solid !important;
border-width: 1px 1px 0 1px !important;
}
:host-context([darktheme="true"][isMobile="true"]) .dropdownTitle {
border-color: white !important;
}
:host-context([darktheme="false"][isMobile="true"]) .dropdownTitle {
border-color: black !important;
}
\ No newline at end of file
<!-- TODO remove dependency on ismobile --> <!-- TODO remove dependency on ismobile -->
<span <span
class="btn btn-default" class="btn btn-default dropdownTitle"
[innerHTML]="activeDisplay(selectedItem)" [innerHTML]="activeDisplay(selectedItem)"
[hoverable]="{translateY:-2}" [hoverable]="{translateY:-2}"
#dropdownToggle #dropdownToggle
dropdownToggle dropdownToggle
[ngClass]="openState ? 'dropdownTitleOpen' : 'dropdownTitle'">
[ngStyle]="{'border': isMobile? 'none' : 'none', 'border-color': darktheme? 'white' : 'black', 'border-width': openState? '1px 1px 0 1px' : ''}">
</span> </span>
<!-- needed to ensure dropdown width matches --> <!-- needed to ensure dropdown width matches -->
...@@ -24,8 +22,5 @@ ...@@ -24,8 +22,5 @@
[selectedItem]="selectedItem" [selectedItem]="selectedItem"
[inputArray]="inputArray" [inputArray]="inputArray"
[@showState]="openState ? 'show' : 'hide'" [@showState]="openState ? 'show' : 'hide'"
[isMobile]="isMobile"
[darktheme]="darktheme"
(listItemButtonClicked) = listItemButtonClicked.emit($event)> (listItemButtonClicked) = listItemButtonClicked.emit($event)>
</radio-list> </radio-list>
...@@ -27,9 +27,6 @@ export class RadioList{ ...@@ -27,9 +27,6 @@ export class RadioList{
@Input() checkSelected: (selectedItem:any, item:any) => boolean = (si,i) => si === i @Input() checkSelected: (selectedItem:any, item:any) => boolean = (si,i) => si === i
@Input() isMobile: boolean
@Input() darktheme: boolean
@Output() listItemButtonClicked = new EventEmitter<string>(); @Output() listItemButtonClicked = new EventEmitter<string>();
clickListButton(i) { clickListButton(i) {
......
...@@ -68,4 +68,19 @@ ul,span.dropdown-item-1 ...@@ -68,4 +68,19 @@ ul,span.dropdown-item-1
min-width: 24px; min-width: 24px;
cursor: pointer; cursor: pointer;
text-align: center; text-align: center;
}
:host-context([darktheme="true"]) .radioListMenu {
border-color: white;
}
:host-context([darktheme="false"]) .radioListMenu {
border-color: black;
}
:host-context([isMobile="true"]) .radioListMenu {
opacity: 1;
border-style: solid;
border-width: 0px 1px 1px 1px;
}
:host-context([isMobile="false"]) radioListMenu {
opacity: 0.8;
} }
\ No newline at end of file
<ul <ul
[ngClass]="ulClass" [ngClass]="ulClass"
[ngStyle]="{'opacity': isMobile? '1' : '0.8', 'border-color': darktheme? 'white' : 'black'}" class="radioListMenu"
role="menu"> role="menu">
<li <li
*ngFor="let input of inputArray; let i = index" *ngFor="let input of inputArray; let i = index"
......
...@@ -7,9 +7,7 @@ ...@@ -7,9 +7,7 @@
[activeDisplay]="displayActiveTemplate" [activeDisplay]="displayActiveTemplate"
[selectedItem]="selectedTemplate$ | async" [selectedItem]="selectedTemplate$ | async"
[inputArray]="loadedTemplates$ | async | filterNull" [inputArray]="loadedTemplates$ | async | filterNull"
[isMobile] = "isMobile"
[ngClass]="isMobile ? flexItemIsMobileClass : flexItemIsDesktopClass" [ngClass]="isMobile ? flexItemIsMobileClass : flexItemIsDesktopClass"
[darktheme] ="darktheme"
(listItemButtonClicked)="showInfoToast($event, 'template')"> (listItemButtonClicked)="showInfoToast($event, 'template')">
</dropdown-component> </dropdown-component>
...@@ -21,9 +19,7 @@ ...@@ -21,9 +19,7 @@
[activeDisplay]="displayActiveParcellation" [activeDisplay]="displayActiveParcellation"
[selectedItem]="selectedParcellation" [selectedItem]="selectedParcellation"
[inputArray]="selectedTemplate.parcellations" [inputArray]="selectedTemplate.parcellations"
[isMobile] = "isMobile"
[ngClass]="isMobile ? flexItemIsMobileClass : flexItemIsDesktopClass" [ngClass]="isMobile ? flexItemIsMobileClass : flexItemIsDesktopClass"
[darktheme] ="darktheme"
(listItemButtonClicked)="showInfoToast($event, 'parcellation')">> (listItemButtonClicked)="showInfoToast($event, 'parcellation')">>
</dropdown-component> </dropdown-component>
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment