Skip to content

Commit ba050c5

Browse files
committed
change: pass app and plugin to settings
1 parent 1f5145c commit ba050c5

File tree

1 file changed

+40
-39
lines changed

1 file changed

+40
-39
lines changed

src/settings/sections/SettingsSection.ts

Lines changed: 40 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ export class SettingsSection extends PluginSettingTab
122122
{
123123
super( app, plugin )
124124

125+
this.app = app
125126
this.plugin = plugin
126127
this.Hide_Global = true
127128
this.Hide_Github = true
@@ -148,9 +149,9 @@ export class SettingsSection extends PluginSettingTab
148149
associated to hovering color picker, not color element
149150
*/
150151

151-
new_ColorPicker( plugin: GistrPlugin, el: HTMLElement, setting: Setting, id: keyof ColorPickrOpts, bHidden?: ( ) => boolean )
152+
new_ColorPicker( app: App, plugin: GistrPlugin, el: HTMLElement, setting: Setting, id: keyof ColorPickrOpts, bHidden?: ( ) => boolean )
152153
{
153-
const pickr: ColorPicker = new ColorPicker( plugin, el, setting )
154+
const pickr: ColorPicker = new ColorPicker( app, plugin, el, setting )
154155

155156
pickr
156157
.on( "init", ( color: Pickr.HSVaColor, instance: Pickr ) =>
@@ -591,7 +592,7 @@ export class SettingsSection extends PluginSettingTab
591592
.setDesc( cfg_tab_og_cb_light_desc )
592593
.then( ( setting ) => { this.new_ColorPicker
593594
(
594-
this.plugin, elm, setting,
595+
this.app, this.plugin, elm, setting,
595596
"og_clr_bg_light",
596597
) } )
597598

@@ -611,7 +612,7 @@ export class SettingsSection extends PluginSettingTab
611612
.setDesc( cfg_tab_og_cb_dark_desc )
612613
.then( ( setting ) => { this.new_ColorPicker
613614
(
614-
this.plugin, elm, setting,
615+
this.app, this.plugin, elm, setting,
615616
"og_clr_bg_dark",
616617
) } )
617618

@@ -631,7 +632,7 @@ export class SettingsSection extends PluginSettingTab
631632
.setDesc( cfg_tab_og_tx_light_desc )
632633
.then( ( setting ) => { this.new_ColorPicker
633634
(
634-
this.plugin, elm, setting,
635+
this.app, this.plugin, elm, setting,
635636
"og_clr_tx_light",
636637
) } )
637638

@@ -649,10 +650,10 @@ export class SettingsSection extends PluginSettingTab
649650
new Setting( elm )
650651
.setName( lng( "cfg_tab_og_tx_dark_name" ) )
651652
.setDesc( cfg_tab_og_tx_dark_desc )
652-
.then( ( setting ) => { this.new_ColorPicker
653-
(
654-
this.plugin, elm, setting,
655-
"og_clr_tx_dark",
653+
.then( ( setting ) => { this.new_ColorPicker
654+
(
655+
this.app, this.plugin, elm, setting,
656+
"og_clr_tx_dark",
656657
) } )
657658

658659
/*
@@ -669,10 +670,10 @@ export class SettingsSection extends PluginSettingTab
669670
new Setting( elm )
670671
.setName( lng( "cfg_tab_og_sb_light_name" ) )
671672
.setDesc( cfg_tab_og_sb_light_desc )
672-
.then( ( setting ) => { this.new_ColorPicker
673-
(
674-
this.plugin, elm, setting,
675-
"og_clr_sb_light",
673+
.then( ( setting ) => { this.new_ColorPicker
674+
(
675+
this.app, this.plugin, elm, setting,
676+
"og_clr_sb_light",
676677
) } )
677678

678679
/*
@@ -689,10 +690,10 @@ export class SettingsSection extends PluginSettingTab
689690
new Setting( elm )
690691
.setName( lng( "cfg_tab_og_sb_dark_name" ) )
691692
.setDesc( cfg_tab_og_sb_dark_desc )
692-
.then( ( setting ) => { this.new_ColorPicker
693-
(
694-
this.plugin, elm, setting,
695-
"og_clr_sb_dark",
693+
.then( ( setting ) => { this.new_ColorPicker
694+
(
695+
this.app, this.plugin, elm, setting,
696+
"og_clr_sb_dark",
696697
) } )
697698

698699
/*
@@ -1272,7 +1273,7 @@ export class SettingsSection extends PluginSettingTab
12721273
.setDesc( cfg_tab_gh_cb_light_desc )
12731274
.then( ( setting ) => { this.new_ColorPicker
12741275
(
1275-
this.plugin, elm, setting,
1276+
this.app, this.plugin, elm, setting,
12761277
"gh_clr_bg_light",
12771278
) } )
12781279

@@ -1290,10 +1291,10 @@ export class SettingsSection extends PluginSettingTab
12901291
new Setting( elm )
12911292
.setName( lng( "cfg_tab_gh_cb_dark_name" ) )
12921293
.setDesc( cfg_tab_gh_cb_dark_desc )
1293-
.then( ( setting ) => { this.new_ColorPicker
1294-
(
1295-
this.plugin, elm, setting,
1296-
"gh_clr_bg_dark",
1294+
.then( ( setting ) => { this.new_ColorPicker
1295+
(
1296+
this.app, this.plugin, elm, setting,
1297+
"gh_clr_bg_dark",
12971298
) } )
12981299

12991300
/*
@@ -1312,7 +1313,7 @@ export class SettingsSection extends PluginSettingTab
13121313
.setDesc( cfg_tab_gh_tx_light_desc )
13131314
.then( ( setting ) => { this.new_ColorPicker
13141315
(
1315-
this.plugin, elm, setting,
1316+
this.app, this.plugin, elm, setting,
13161317
"gh_clr_tx_light",
13171318
) } )
13181319

@@ -1330,10 +1331,10 @@ export class SettingsSection extends PluginSettingTab
13301331
new Setting( elm )
13311332
.setName( lng( "cfg_tab_gh_tx_dark_name" ) )
13321333
.setDesc( cfg_tab_gh_tx_dark_desc )
1333-
.then( ( setting ) => { this.new_ColorPicker
1334-
(
1335-
this.plugin, elm, setting,
1336-
"gh_clr_tx_dark",
1334+
.then( ( setting ) => { this.new_ColorPicker
1335+
(
1336+
this.app, this.plugin, elm, setting,
1337+
"gh_clr_tx_dark",
13371338
) } )
13381339

13391340

@@ -1351,10 +1352,10 @@ export class SettingsSection extends PluginSettingTab
13511352
new Setting( elm )
13521353
.setName( lng( "cfg_tab_gh_sb_light_name" ) )
13531354
.setDesc( cfg_tab_gh_sb_light_name )
1354-
.then( ( setting ) => { this.new_ColorPicker
1355-
(
1356-
this.plugin, elm, setting,
1357-
"gh_clr_sb_light",
1355+
.then( ( setting ) => { this.new_ColorPicker
1356+
(
1357+
this.app, this.plugin, elm, setting,
1358+
"gh_clr_sb_light",
13581359
) } )
13591360

13601361
/*
@@ -1371,10 +1372,10 @@ export class SettingsSection extends PluginSettingTab
13711372
new Setting( elm )
13721373
.setName( lng( "cfg_tab_gh_sb_dark_name" ) )
13731374
.setDesc( cfg_tab_gh_sb_dark_desc )
1374-
.then( ( setting ) => { this.new_ColorPicker
1375-
(
1376-
this.plugin, elm, setting,
1377-
"gh_clr_sb_dark",
1375+
.then( ( setting ) => { this.new_ColorPicker
1376+
(
1377+
this.app, this.plugin, elm, setting,
1378+
"gh_clr_sb_dark",
13781379
) } )
13791380

13801381
/*
@@ -1852,10 +1853,10 @@ export class SettingsSection extends PluginSettingTab
18521853
new Setting( elm )
18531854
.setName( lng( "cfg_tab_sy_list_icon_name" ) )
18541855
.setDesc( cfg_tab_sy_list_icon_desc )
1855-
.then( ( setting ) => { this.new_ColorPicker
1856-
(
1857-
this.plugin, elm, setting,
1858-
"sy_clr_lst_icon",
1856+
.then( ( setting ) => { this.new_ColorPicker
1857+
(
1858+
this.app, this.plugin, elm, setting,
1859+
"sy_clr_lst_icon",
18591860
) } )
18601861

18611862
/*

0 commit comments

Comments
 (0)