This repository was archived by the owner on May 5, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 5 files changed +12
-6
lines changed Expand file tree Collapse file tree 5 files changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -33,6 +33,8 @@ export class JWPlugin<T extends JWPluginConfig = {}> {
33
33
async stop ( ) : Promise < void > {
34
34
// This is where plugins can do asynchronous work when the editor is
35
35
// stopping (e.g. save on a server, close connections, etc).
36
+ this . dependencies . clear ( ) ;
37
+ this . editor = null ;
36
38
}
37
39
}
38
40
export interface JWPlugin {
Original file line number Diff line number Diff line change @@ -37,6 +37,7 @@ export class DomEditable<T extends JWPluginConfig = JWPluginConfig> extends JWPl
37
37
async stop ( ) : Promise < void > {
38
38
this . eventNormalizer . destroy ( ) ;
39
39
window . removeEventListener ( 'keydown' , this . _processKeydown ) ;
40
+ return super . stop ( ) ;
40
41
}
41
42
42
43
/**
Original file line number Diff line number Diff line change @@ -15,6 +15,14 @@ export class Renderer<T extends JWPluginConfig = JWPluginConfig> extends JWPlugi
15
15
} ;
16
16
engines : Record < RenderingIdentifier , RenderingEngine > = { } ;
17
17
18
+ /**
19
+ * @override
20
+ */
21
+ stop ( ) : Promise < void > {
22
+ this . engines = { } ;
23
+ return super . stop ( ) ;
24
+ }
25
+
18
26
/**
19
27
* Render the VNode and return the rendering.
20
28
*
Original file line number Diff line number Diff line change @@ -127,8 +127,8 @@ export class Template<T extends TemplateConfig = TemplateConfig> extends JWPlugi
127
127
const filledZone = new Set < ZoneIdentifier > ( ) ;
128
128
for ( const templateName of templateToSelect ) {
129
129
const config = templateConfigurations [ templateName ] ;
130
- await layout . clear ( config . zoneId ) ;
131
130
if ( ! filledZone . has ( config . thumbnailZoneId ) ) {
131
+ await layout . clear ( config . zoneId ) ;
132
132
filledZone . add ( config . thumbnailZoneId ) ;
133
133
await layout . prepend (
134
134
'TemplateThumbnailSelector-' + config . thumbnailZoneId ,
Original file line number Diff line number Diff line change @@ -11,7 +11,6 @@ import { ThemeNode } from './ThemeNode';
11
11
import { ZoneNode } from '../../plugin-layout/src/ZoneNode' ;
12
12
import { ActionableGroupNode } from '../../plugin-layout/src/ActionableGroupNode' ;
13
13
import { ActionableNode } from '../../plugin-layout/src/ActionableNode' ;
14
- import { DomLayoutEngine } from '../../plugin-dom-layout/src/DomLayoutEngine' ;
15
14
import { VElement } from '../../core/src/VNodes/VElement' ;
16
15
17
16
interface ThemeComponent extends ComponentDefinition {
@@ -103,10 +102,6 @@ export class Theme<T extends ThemeConfig = ThemeConfig> extends JWPlugin<T> {
103
102
const ancestor = this . editor . selection . anchor . ancestor ( ThemeNode ) ;
104
103
if ( ancestor ) {
105
104
ancestor . themeName = params . theme ;
106
-
107
- // TODO: remove this redraw when memory send the nodes to redraw into domLayout
108
- const domEngine = this . editor . plugins . get ( Layout ) . engines . dom as DomLayoutEngine ;
109
- await domEngine . redraw ( ancestor ) ;
110
105
}
111
106
}
112
107
}
You can’t perform that action at this time.
0 commit comments