Skip to content

Commit 543378c

Browse files
authored
Merge pull request #5917 from Countly/SER-2143-content-position-options-should-be-active-according-to-the-devices
[Feat] Add disabled state to option swapper
2 parents c08daca + 639a20d commit 543378c

File tree

3 files changed

+18
-3
lines changed

3 files changed

+18
-3
lines changed

frontend/express/public/javascripts/countly/vue/components/content.js

+5
Original file line numberDiff line numberDiff line change
@@ -527,6 +527,11 @@
527527
template: CV.T('/javascripts/countly/vue/templates/UI/option-swapper.html'),
528528

529529
props: {
530+
disabled: {
531+
default: false,
532+
type: Boolean
533+
},
534+
530535
highlightOnSelect: {
531536
default: true,
532537
type: Boolean

frontend/express/public/javascripts/countly/vue/templates/UI/option-swapper.html

+7-3
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,17 @@
1-
<!-- :style="{'width': width + 'px'}" -->
2-
<div class="cly-option-swapper">
1+
<div
2+
class="cly-option-swapper"
3+
:class="{
4+
'cly-option-swapper--disabled': disabled
5+
}"
6+
>
37
<div
48
v-for="(option, index) in options"
59
:key="`cly-option-swapper-option-${index}`"
610
v-tooltip="option.tooltip"
711
class="cly-option-swapper__option"
812
:class="{
913
'cly-option-swapper__option--active': option.value === selectedOption,
10-
'cly-option-swapper__option--disabled': option.disabled,
14+
'cly-option-swapper__option--disabled': option.disabled || disabled,
1115
'cly-option-swapper__option--first': index === 0,
1216
'cly-option-swapper__option--last': index === (options.length - 1),
1317
'cly-option-swapper__option--no-highlight': !highlightOnSelect

frontend/express/public/stylesheets/vue/clyvue.scss

+6
Original file line numberDiff line numberDiff line change
@@ -4829,6 +4829,12 @@
48294829
background: #F6F6F6;
48304830
}
48314831
}
4832+
4833+
// .cly-option-swapper--disabled
4834+
&--disabled {
4835+
cursor: not-allowed;
4836+
opacity: 0.5;
4837+
}
48324838
}
48334839

48344840
.cly-list-drawer {

0 commit comments

Comments
 (0)