20
20
<blip-card-date :status =" status" :position =" position" :date =" date" :failed-to-send-msg =" failedToSendMsg"
21
21
:is-external-message =" isExternalMessage" :external-message-text =" externalMessageText" />
22
22
</div >
23
- <transition name =" fade" >
24
- <div :class =" 'slideshow-container ' + position" :id =" id" v-touch:swipe.left =" swipeLeftHandler" v-touch:swipe.right =" swipeRightHandler"
25
- v-if =" !hide" >
23
+ <div :class =" 'slideshow-container ' + position" :id =" id" v-touch:swipe.left =" swipeLeftHandler" v-touch:swipe.right =" swipeRightHandler" >
26
24
<div class =" slideshow-list" >
27
25
<div class =" slideshow-track options" >
28
26
<ul class =" item-list" >
29
- <li v-for =" (item, index) in options" v-bind:key =" index" @click =" select(item)" class =" disable-selection"
30
- v-bind:class =" { readonly: readonly }" >
27
+ <li
28
+ v-for =" (item, index) in options"
29
+ v-bind:key =" index"
30
+ @click =" disableOptions ? null : select(item, index)"
31
+ class =" disable-selection"
32
+ :class =" `${disableOptions && index != selectedIndex ? ' unselected-option' : ''} ${disableOptions ? ' pointer-default' : ''}`" >
31
33
<div v-html =" sanitize(item.previewText)" ></div >
32
34
</li >
33
35
</ul >
37
39
<a class =" prev" v-if =" showPrev" @dblclick =" $event.stopPropagation()" @click =" plusSlides(-1)" >❮ ; </a >
38
40
<a class =" next" v-if =" showNext" @dblclick =" $event.stopPropagation()" @click =" plusSlides(1)" >❯ ; </a >
39
41
</div >
40
-
41
- </transition >
42
42
</div >
43
43
44
44
<div v-else :class =" isFailedMessage(status, position)" >
52
52
</bds-button-icon >
53
53
54
54
<div class =" text-left" v-html =" sanitize(computedText)" ></div >
55
- <transition name =" fade" >
56
55
<div :class =" 'slideshow-container ' + position" :id =" id" v-touch:swipe.left =" swipeLeftHandler"
57
- v-touch:swipe.right =" swipeRightHandler" v-if = " !hide " >
56
+ v-touch:swipe.right =" swipeRightHandler" >
58
57
<div class =" fixed-options" >
59
58
<ul class =" item-list" >
60
- <li v-for =" (item, index) in options" v-bind:key =" index" @click =" select(item)" class =" disable-selection" >
59
+ <li
60
+ v-for =" (item, index) in options"
61
+ v-bind:key =" index"
62
+ @click =" disableOptions ? null : select(item, index)"
63
+ class =" disable-selection"
64
+ :class =" `${disableOptions && selectedIndex != index ? ' unselected-option' : ''} ${disableOptions ? ' pointer-default' : ''}`" >
61
65
<div v-html =" sanitize(item.previewText)" ></div >
62
66
</li >
63
67
</ul >
64
68
</div >
65
69
</div >
66
- </transition >
67
70
</div >
68
71
</div >
69
72
</div >
@@ -227,7 +230,8 @@ export default {
227
230
showPayload: undefined ,
228
231
headerTab: undefined ,
229
232
selectedOption: undefined ,
230
- hide: undefined ,
233
+ disableOptions: undefined ,
234
+ selectedIndex: undefined ,
231
235
text: undefined ,
232
236
options: undefined ,
233
237
id: undefined ,
@@ -260,7 +264,7 @@ export default {
260
264
},
261
265
watch: {
262
266
hideOptions : function () {
263
- this .hide = this .hideOptions
267
+ this .disableOptions = this .hideOptions
264
268
},
265
269
document : function () {
266
270
this .init ()
@@ -275,7 +279,7 @@ export default {
275
279
this .showPayload = false
276
280
this .headerTab = ' plainText'
277
281
this .selectedOption = { value: {} }
278
- this .hide = this .hideOptions
282
+ this .disableOptions = this .hideOptions
279
283
this .text = this .document .text
280
284
this .options = this .document .options .map (function (x ) {
281
285
let value
@@ -474,11 +478,12 @@ export default {
474
478
this .cancel ()
475
479
},
476
480
select: debounce (
477
- function (item ) {
481
+ function (item , index ) {
478
482
if (this .readonly ) return
479
483
480
484
if (! this .editable ) {
481
- this .hide = true
485
+ this .disableOptions = true
486
+ this .selectedIndex = index
482
487
}
483
488
484
489
if (this .onSelected ) {
@@ -510,6 +515,14 @@ export default {
510
515
<style lang="scss">
511
516
@import ' ../styles/variables.scss' ;
512
517
518
+ .pointer-default {
519
+ cursor : default !important ;
520
+ }
521
+
522
+ .unselected-option {
523
+ opacity : 0.33 ;
524
+ }
525
+
513
526
.select .bubble {
514
527
padding : $bubble-padding ;
515
528
min-width : auto ;
0 commit comments