@@ -63,10 +63,11 @@ class CreateCheckboxesModal extends Modal {
6363 this . snippetor = snippetor ;
6464 this . containerEl . addClass ( "snippetor-checkboxes-modal" ) ;
6565 this . containerEl . id = "snippetor-modal" ;
66- this . cfg = taskSnippetCfg || snippetor . createNewTaskSnippetCfg ( ) ;
6766
6867 // Ensure required config, migrate old task data
69- this . snippetor . initTaskSnippetConfig ( this . cfg ) ;
68+ this . cfg = this . snippetor . initTaskSnippetConfig (
69+ taskSnippetCfg || snippetor . createNewTaskSnippetCfg ( )
70+ ) ;
7071
7172 // save snapshot of task settings
7273 this . origTaskSettings = JSON . parse (
@@ -97,7 +98,7 @@ class CreateCheckboxesModal extends Modal {
9798 } ) ;
9899
99100 this . elements . list = content . createEl ( "ul" , {
100- cls : "contains-task-list has-list-bullet"
101+ cls : "contains-task-list has-list-bullet" ,
101102 } ) ;
102103
103104 this . showTasks ( ) ;
@@ -329,10 +330,7 @@ class CreateCheckboxesModal extends Modal {
329330 }
330331 }
331332
332- drawCheckboxSettings (
333- ts : TaskSettings ,
334- parent : HTMLSpanElement
335- ) : void {
333+ drawCheckboxSettings ( ts : TaskSettings , parent : HTMLSpanElement ) : void {
336334 const settings = parent . createSpan ( "snippetor-row" ) ;
337335 const i = ts . cache . i ;
338336
@@ -471,7 +469,9 @@ class CreateCheckboxesModal extends Modal {
471469 fontSize . sliderEl . name = "size-" + i ;
472470 new ExtraButtonComponent ( sizeGroup )
473471 . setIcon ( "reset" )
474- . setTooltip ( "Reset font size to default: " + this . elements . defaultFontSize )
472+ . setTooltip (
473+ "Reset font size to default: " + this . elements . defaultFontSize
474+ )
475475 . onClick ( async ( ) => {
476476 fontSize . setValue ( this . elements . defaultFontSize ) ;
477477 Reflect . deleteProperty ( ts . checkbox . format , "fontSize" ) ;
@@ -528,10 +528,7 @@ class CreateCheckboxesModal extends Modal {
528528 ) ;
529529 }
530530
531- drawTextSettings (
532- ts : TaskSettings ,
533- parent : HTMLSpanElement
534- ) : void {
531+ drawTextSettings ( ts : TaskSettings , parent : HTMLSpanElement ) : void {
535532 const i = ts . cache . i ;
536533
537534 const settings = parent . createSpan ( "snippetor-row text-settings" ) ;
@@ -586,7 +583,9 @@ class CreateCheckboxesModal extends Modal {
586583 fontSize . sliderEl . name = "size-" + i ;
587584 new ExtraButtonComponent ( sizeGroup )
588585 . setIcon ( "reset" )
589- . setTooltip ( "Reset font size to default: " + this . elements . defaultFontSize )
586+ . setTooltip (
587+ "Reset font size to default: " + this . elements . defaultFontSize
588+ )
590589 . onClick ( async ( ) => {
591590 fontSize . setValue ( this . elements . defaultFontSize ) ;
592591 Reflect . deleteProperty ( ts . checkbox . format , "fontSize" ) ;
@@ -645,10 +644,7 @@ class CreateCheckboxesModal extends Modal {
645644 ) ;
646645 }
647646
648- drawFontSettings (
649- ts : TaskSettings ,
650- parent : HTMLSpanElement
651- ) : void {
647+ drawFontSettings ( ts : TaskSettings , parent : HTMLSpanElement ) : void {
652648 const i = ts . cache . i ;
653649
654650 const settings = parent . createSpan ( "snippetor-row text-settings" ) ;
@@ -678,7 +674,6 @@ class CreateCheckboxesModal extends Modal {
678674 } ) ;
679675 textFont . inputEl . addClass ( "snippetor-font-setting" ) ;
680676
681-
682677 // List Item font
683678 const chkboxGroup = settings . createSpan (
684679 "snippetor-group decorated checkbox-font"
@@ -690,7 +685,8 @@ class CreateCheckboxesModal extends Modal {
690685 this . snippetor . initialize ( ts , "checkbox" , "format" ) ;
691686 const boxFont = new TextComponent ( chkboxGroup )
692687 . setValue (
693- ts . checkbox . format === undefined || ts . checkbox . format . font === undefined
688+ ts . checkbox . format === undefined ||
689+ ts . checkbox . format . font === undefined
694690 ? ""
695691 : ts . checkbox . format . font
696692 )
@@ -841,7 +837,6 @@ class CreateCheckboxesModal extends Modal {
841837 applySettingsToElements ( taskSettings : TaskSettings ) : void {
842838 const itemEl = taskSettings . cache . itemEl ;
843839 const checkboxEl = taskSettings . cache . checkboxEl ;
844- const textEl = taskSettings . cache . textEl ;
845840
846841 // data-line attribute
847842 itemEl . setAttribute ( "data-line" , taskSettings . cache . i + "" ) ;
@@ -881,6 +876,9 @@ class CreateCheckboxesModal extends Modal {
881876 if ( taskSettings . li . format && taskSettings . li . format . fontSize ) {
882877 fontSize = taskSettings . li . format . fontSize + "px" ;
883878 }
879+ if ( taskSettings . li . format && taskSettings . li . format . font ) {
880+ font = taskSettings . li . format . font ;
881+ }
884882
885883 textEl . style . setProperty ( "--snippetor-text-decoration" , decoration ) ;
886884 textEl . style . setProperty ( "--snippetor-text-font" , font ) ;
@@ -914,17 +912,22 @@ class CreateCheckboxesModal extends Modal {
914912 COLOR . BACKGROUND
915913 ) ;
916914
917- li . style . setProperty ( "--checkbox-color" ,
915+ li . style . setProperty (
916+ "--checkbox-color" ,
918917 boxFgColor === "inherit" ? "var(--text-normal)" : boxFgColor
919918 ) ;
920919
921920 li . style . setProperty ( "--checkbox-bg" , boxBgColor ) ;
922- li . style . setProperty ( "--checkbox-border-color" ,
921+ li . style . setProperty (
922+ "--checkbox-border-color" ,
923923 taskSettings . checkbox . hideBorder ? "transparent" : boxFgColor
924924 ) ;
925925
926926 if ( this . cfg . borderRadius ) {
927- li . style . setProperty ( "--checkbox-radius" , this . cfg . borderRadius + "%" ) ;
927+ li . style . setProperty (
928+ "--checkbox-radius" ,
929+ this . cfg . borderRadius + "%"
930+ ) ;
928931 } else {
929932 li . style . removeProperty ( "--checkbox-radius" ) ;
930933 }
@@ -934,7 +937,6 @@ class CreateCheckboxesModal extends Modal {
934937 }
935938
936939 setCheckboxStyles ( taskSettings : TaskSettings ) : void {
937- const li = taskSettings . cache . itemEl ;
938940 const checkbox = taskSettings . cache . checkboxEl ;
939941
940942 // content value for snippetor
@@ -949,17 +951,22 @@ class CreateCheckboxesModal extends Modal {
949951 if ( taskSettings . checkbox . format && taskSettings . checkbox . format . font ) {
950952 font = taskSettings . checkbox . format . font ;
951953 }
952- if ( taskSettings . checkbox . format && taskSettings . checkbox . format . fontSize ) {
954+ if (
955+ taskSettings . checkbox . format &&
956+ taskSettings . checkbox . format . fontSize
957+ ) {
953958 fontSize = taskSettings . checkbox . format . fontSize + "px" ;
954959 }
955960
956961 checkbox . style . setProperty ( "--snippetor-box-font" , font ) ;
957962 checkbox . style . setProperty ( "--snippetor-box-font-size" , fontSize ) ;
958963
959- checkbox . style . setProperty ( "--snippetor-box-top" ,
964+ checkbox . style . setProperty (
965+ "--snippetor-box-top" ,
960966 ( taskSettings . checkbox . top ? taskSettings . checkbox . top : 0 ) + "px"
961967 ) ;
962- checkbox . style . setProperty ( "--snippetor-box-left" ,
968+ checkbox . style . setProperty (
969+ "--snippetor-box-left" ,
963970 ( taskSettings . checkbox . left ? taskSettings . checkbox . left : 0 ) + "px"
964971 ) ;
965972 }
0 commit comments