File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2323 z-index : 2 ;
2424 }
2525
26+ # just-os-dismiss {
27+ position : absolute;
28+ top : -6px ;
29+ right : -6px ;
30+ width : 20px ;
31+ height : 20px ;
32+ border-radius : 50% ;
33+ border : 1px solid # ccc ;
34+ background : white;
35+ color : # 999 ;
36+ font-size : 14px ;
37+ line-height : 18px ;
38+ text-align : center;
39+ cursor : pointer;
40+ z-index : 3 ;
41+ opacity : 0 ;
42+ transition : opacity 0.2s ease;
43+ padding : 0 ;
44+ }
45+
46+ # just-os-widget : hover # just-os-dismiss {
47+ opacity : 1 ;
48+ }
49+
50+ # just-os-dismiss : hover {
51+ background : # eee ;
52+ color : # 333 ;
53+ }
54+
2655 # just-os-btn : hover {
2756 transform : scale (1.05 );
2857 }
388417{{ if ne .RelPermalink "/just_os_chatbot/" }}
389418< div id ="just-os-widget ">
390419
420+ <!-- Dismiss Button -->
421+ < button id ="just-os-dismiss " onclick ="dismissJustOS() " aria-label ="Dismiss chatbot " title ="Dismiss "> ×</ button >
422+
391423 <!-- Toggle Button -->
392424 < button id ="just-os-btn " onclick ="toggleJustOS() " aria-label ="Open Chatbot ">
393425 < img id ="just-os-img " src ="/img/just_os_icon.webp " alt ="Chat with us ">
Original file line number Diff line number Diff line change 450450
451451 window . newJustOSChat = newChat ;
452452
453+ window . dismissJustOS = function ( ) {
454+ var widget = document . getElementById ( 'just-os-widget' ) ;
455+ if ( widget ) widget . style . display = 'none' ;
456+ sessionStorage . setItem ( 'just-os-dismissed' , '1' ) ;
457+ } ;
458+
453459 /* -------------------------------------------------- */
454460 /* Custom drag-resize (bottom-left handle) */
455461 /* -------------------------------------------------- */
509515 /* -------------------------------------------------- */
510516
511517 function init ( ) {
518+ // Hide widget if dismissed this session
519+ if ( sessionStorage . getItem ( 'just-os-dismissed' ) ) {
520+ var widget = document . getElementById ( 'just-os-widget' ) ;
521+ if ( widget ) widget . style . display = 'none' ;
522+ return ;
523+ }
524+
512525 const container = getContainer ( ) ;
513526 if ( ! container ) return ;
514527
529542 window . addEventListener ( 'beforeunload' , saveState ) ;
530543
531544 // Auto-toggle helper bubble every 10 seconds (widget only)
532- setInterval ( function ( ) {
545+ var bubbleInterval = setInterval ( function ( ) {
546+ if ( sessionStorage . getItem ( 'just-os-dismissed' ) ) {
547+ clearInterval ( bubbleInterval ) ;
548+ return ;
549+ }
533550 const bubble = document . getElementById ( 'just-os-bubble' ) ;
534551 const win = document . getElementById ( 'just-os-window' ) ;
535552 if ( bubble && win && win . style . display !== 'flex' ) {
You can’t perform that action at this time.
0 commit comments