File tree Expand file tree Collapse file tree 3 files changed +26
-19
lines changed Expand file tree Collapse file tree 3 files changed +26
-19
lines changed Original file line number Diff line number Diff line change 11import { ImplementsStatic } from 'src/classes/decorators/ImplementsStatic' ;
22import type { ILogger , ILogger_ } from 'src/interfaces/ILogger' ;
3+ import { broadcastEvent , DIComponent } from 'src/libs/DIComponent' ;
34import type { IFlow_ , IFlowApi } from 'src/libs/HTMLFlow/interfaces/IFlow' ;
45import { Opts } from 'src/libs/HTMLFlow/Opts' ;
56import { IFlowConfig } from 'src/libs/HTMLFlow/types/IFlowDelegates' ;
@@ -22,7 +23,6 @@ import {
2223 IOpenCallback ,
2324 IShouldOpenCallback ,
2425} from './types/IModalCallbacks' ;
25- import { DIComponent } from '../../DIComponent/DIComponent' ;
2626
2727/**
2828 * Represents a custom modal, which can be dragged around
@@ -233,6 +233,15 @@ export class Modal extends DIComponent implements IModal, IModalFluentApi {
233233 */
234234 public override onload ( ) : void {
235235 this . _open ( ) ;
236+
237+ /**
238+ * Broadcast the common window classes to the plugin.
239+ */
240+ if ( this . _draggableElement ?. className != null ) {
241+ this [ broadcastEvent ] ( 'common-window-classes' , [
242+ this . _draggableElement . className ,
243+ ] ) ;
244+ }
236245 }
237246
238247 /**
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ import createFuzzySearch from '@nozbe/microfuzz';
22import { ImplementsStatic } from 'src/classes/decorators/ImplementsStatic' ;
33import type { IApp } from 'src/interfaces/IApp' ;
44import type { ILogger , ILogger_ } from 'src/interfaces/ILogger' ;
5+ import { onEvent } from 'src/libs/DIComponent' ;
56import { DIComponent } from 'src/libs/DIComponent/DIComponent' ;
67import type { IFlow_ , IFlowApi } from 'src/libs/HTMLFlow/interfaces/IFlow' ;
78import { Opts } from 'src/libs/HTMLFlow/Opts' ;
@@ -154,15 +155,6 @@ export class Input
154155 ) ( input ) . map ( ( result ) => result . item . value ) ;
155156 } ,
156157 ) ;
157-
158- const draggableClassName =
159- this . parentSettingItem ?. parentModal ?. draggableClassName ;
160-
161- if ( draggableClassName != null ) {
162- this . _suggester . suggestContainerEl ?. classList . add (
163- draggableClassName ,
164- ) ;
165- }
166158 }
167159
168160 public readonly parentSettingItem : ISettingRowProtected ;
@@ -198,6 +190,13 @@ export class Input
198190 ) ;
199191
200192 this . addChild ( flow ) ;
193+
194+ /**
195+ * Adds the common window classes to the suggester container.
196+ */
197+ this [ onEvent ] ( 'common-window-classes' , ( classes : string [ ] ) => {
198+ this . _suggester ?. suggestContainerEl ?. classList . add ( ...classes ) ;
199+ } ) ;
201200 }
202201
203202 /**
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ import createFuzzySearch from '@nozbe/microfuzz';
22import { LazzyLoading } from 'src/classes/decorators/LazzyLoading' ;
33import type { IApp } from 'src/interfaces/IApp' ;
44import type { ILogger_ , ILogger } from 'src/interfaces/ILogger' ;
5+ import { onEvent } from 'src/libs/DIComponent' ;
56import { DIComponent } from 'src/libs/DIComponent/DIComponent' ;
67import type { ITag , ITag_ } from 'src/libs/Tags/interfaces/ITag' ;
78import type { ITags , ITags_ } from 'src/libs/Tags/interfaces/ITags' ;
@@ -149,6 +150,13 @@ export class TagSearch
149150 public override onload ( ) : void {
150151 this . _configurator ?.( this ) ;
151152 this . build ( ) ;
153+
154+ /**
155+ * Adds the common window classes to the suggester container.
156+ */
157+ this [ onEvent ] ( 'common-window-classes' , ( classes : string [ ] ) => {
158+ this . _suggester ?. suggestContainerEl ?. classList . add ( ...classes ) ;
159+ } ) ;
152160 }
153161
154162 /**
@@ -226,15 +234,6 @@ export class TagSearch
226234 return filteredItems ;
227235 } ,
228236 ) ;
229-
230- const draggableClassName =
231- this . parentSettingItem ?. parentModal ?. draggableClassName ;
232-
233- if ( draggableClassName != null ) {
234- this . _suggester . suggestContainerEl ?. classList . add (
235- draggableClassName ,
236- ) ;
237- }
238237 }
239238 }
240239
You can’t perform that action at this time.
0 commit comments