@@ -636,31 +636,6 @@ class CleanTalkWidgetDoboard {
636636 document . querySelector ( '.doboard_task_widget-login' ) . classList . add ( 'hidden' ) ;
637637 }
638638
639- const descEl = document . querySelector (
640- '.doboard_task_widget-container-maximize #doboard_task_widget-description'
641- ) ;
642-
643- if ( descEl ) {
644- const parentEl = descEl . closest ( '.doboard_task_widget-input-container' ) ;
645-
646- if ( parentEl ) {
647- let isSmall = false ;
648-
649- const ro = new ResizeObserver ( ( [ entry ] ) => {
650- const height = entry . contentRect . height ;
651- const next = height < 120 ;
652-
653- if ( next === isSmall ) return ;
654-
655- isSmall = next ;
656-
657- descEl . classList . toggle ( 'is-small' , isSmall ) ;
658- } ) ;
659-
660- ro . observe ( parentEl ) ;
661- }
662- }
663-
664639 if (
665640 selection . type === 'Range'
666641 ) {
@@ -678,29 +653,33 @@ class CleanTalkWidgetDoboard {
678653 tinymce . remove ( '#doboard_task_widget-description' ) ;
679654 }
680655
681- const savedDescription = localStorage . getItem ( 'spotfix-description' ) || '' ;
656+ const savedDescription = localStorage . getItem ( 'spotfix-description-ls ' ) || '' ;
682657
683658 SpotFixTinyMCE . init ( {
684659 selector : '#doboard_task_widget-description' ,
685660 plugins : 'link lists' ,
686661 menubar : false ,
687662 statusbar : false ,
688663 toolbar_location : 'bottom' ,
664+ height : '100%' ,
665+ width : '100%' ,
689666 toolbar : 'screenshotButton emoticons bullist numlist bold italic strikethrough underline blockquote' ,
690- height : 120 ,
691667 icons : 'icon_pack_SpotFix' ,
692668 file_picker_types : 'file image media' ,
693669 setup : function ( editor ) {
694670 editor . on ( 'init' , function ( ) {
695671 if ( savedDescription ) {
696- editor . setContent ( savedDescription ) ;
697- editor . save ( ) ;
672+ editor . setContent ( savedDescription , { format : 'html' } ) ;
698673 }
674+
675+ setTimeout ( ( ) => {
676+ editor . save ( ) ;
677+ } ) ;
699678 } ) ;
700679 editor . on ( 'change' , function ( ) {
701680 editor . save ( ) ;
702681 const content = editor . getContent ( ) ;
703- localStorage . setItem ( 'spotfix-description' , content ) ;
682+ localStorage . setItem ( 'spotfix-description-ls ' , content ) ;
704683 } ) ;
705684 // editor.ui.registry.addButton('attachmentButton', {
706685 // icon: 'paperclip',
@@ -721,6 +700,7 @@ class CleanTalkWidgetDoboard {
721700 } ) ;
722701 }
723702 } )
703+
724704 break ;
725705 case 'wrap' :
726706 await this . getTaskCount ( ) ;
@@ -996,6 +976,7 @@ class CleanTalkWidgetDoboard {
996976 } ,
997977 ) ;
998978 }
979+
999980 if ( ! this . nonRequesting ) {
1000981 issuesCommentsContainer . innerHTML = daysWrapperHTML ;
1001982 } else {
@@ -1043,6 +1024,19 @@ class CleanTalkWidgetDoboard {
10431024 editor . on ( 'change' , function ( ) {
10441025 editor . save ( ) ;
10451026 } ) ;
1027+ editor . on ( 'init' , ( ) => {
1028+ // Scroll to the bottom comments
1029+ if ( ! this . nonRequesting ) {
1030+ const container = document . querySelector ( '.doboard_task_widget-concrete_issues-container' ) ;
1031+
1032+ if ( container ) {
1033+ setTimeout ( ( ) => {
1034+ const scrollPosition = container . scrollHeight ;
1035+ container . scrollTo ( { top : scrollPosition , behavior : 'smooth' } ) ;
1036+ } , 50 ) ;
1037+ }
1038+ }
1039+ } ) ;
10461040 editor . ui . registry . addButton ( 'attachmentButton' , {
10471041 icon : 'paperclip' ,
10481042 tooltip : 'Add file' ,
@@ -1064,20 +1058,20 @@ class CleanTalkWidgetDoboard {
10641058 } ) ;
10651059 }
10661060
1061+ if ( this . nonRequesting ) {
1062+ const container = document . querySelector ( '.doboard_task_widget-concrete_issues-container' ) ;
1063+
1064+ if ( container ) {
1065+ setTimeout ( ( ) => {
1066+ const scrollPosition = container . scrollHeight ;
1067+ container . scrollTo ( { top : scrollPosition , behavior : 'smooth' } ) ;
1068+ } , 50 ) ;
1069+ }
1070+ }
1071+
10671072 // Hide spinner preloader
10681073 hideContainersSpinner ( ) ;
10691074
1070- // Scroll to the bottom comments
1071- if ( ! this . nonRequesting ) {
1072- setTimeout ( ( ) => {
1073- const contentContainer = document . querySelector ( '.doboard_task_widget-content' ) ;
1074- contentContainer . scrollTo ( {
1075- top : contentContainer . scrollHeight ,
1076- behavior : 'smooth' ,
1077- } ) ;
1078- } , 0 ) ;
1079- }
1080-
10811075 const sendButton = document . querySelector ( '.doboard_task_widget-send_message_button' ) ;
10821076 if ( sendButton ) {
10831077 this . fileUploader . init ( ) ;
0 commit comments