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 = {}> {
3333 async stop ( ) : Promise < void > {
3434 // This is where plugins can do asynchronous work when the editor is
3535 // stopping (e.g. save on a server, close connections, etc).
36+ this . dependencies . clear ( ) ;
37+ this . editor = null ;
3638 }
3739}
3840export 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
3737 async stop ( ) : Promise < void > {
3838 this . eventNormalizer . destroy ( ) ;
3939 window . removeEventListener ( 'keydown' , this . _processKeydown ) ;
40+ return super . stop ( ) ;
4041 }
4142
4243 /**
Original file line number Diff line number Diff line change @@ -15,6 +15,14 @@ export class Renderer<T extends JWPluginConfig = JWPluginConfig> extends JWPlugi
1515 } ;
1616 engines : Record < RenderingIdentifier , RenderingEngine > = { } ;
1717
18+ /**
19+ * @override
20+ */
21+ stop ( ) : Promise < void > {
22+ this . engines = { } ;
23+ return super . stop ( ) ;
24+ }
25+
1826 /**
1927 * Render the VNode and return the rendering.
2028 *
Original file line number Diff line number Diff line change @@ -127,8 +127,8 @@ export class Template<T extends TemplateConfig = TemplateConfig> extends JWPlugi
127127 const filledZone = new Set < ZoneIdentifier > ( ) ;
128128 for ( const templateName of templateToSelect ) {
129129 const config = templateConfigurations [ templateName ] ;
130- await layout . clear ( config . zoneId ) ;
131130 if ( ! filledZone . has ( config . thumbnailZoneId ) ) {
131+ await layout . clear ( config . zoneId ) ;
132132 filledZone . add ( config . thumbnailZoneId ) ;
133133 await layout . prepend (
134134 'TemplateThumbnailSelector-' + config . thumbnailZoneId ,
Original file line number Diff line number Diff line change @@ -11,7 +11,6 @@ import { ThemeNode } from './ThemeNode';
1111import { ZoneNode } from '../../plugin-layout/src/ZoneNode' ;
1212import { ActionableGroupNode } from '../../plugin-layout/src/ActionableGroupNode' ;
1313import { ActionableNode } from '../../plugin-layout/src/ActionableNode' ;
14- import { DomLayoutEngine } from '../../plugin-dom-layout/src/DomLayoutEngine' ;
1514import { VElement } from '../../core/src/VNodes/VElement' ;
1615
1716interface ThemeComponent extends ComponentDefinition {
@@ -103,10 +102,6 @@ export class Theme<T extends ThemeConfig = ThemeConfig> extends JWPlugin<T> {
103102 const ancestor = this . editor . selection . anchor . ancestor ( ThemeNode ) ;
104103 if ( ancestor ) {
105104 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 ) ;
110105 }
111106 }
112107}
You can’t perform that action at this time.
0 commit comments