Skip to content

Commit

Permalink
Fix console reload bug in CMP.
Browse files Browse the repository at this point in the history
  • Loading branch information
muzzwood committed Oct 27, 2022
1 parent 0d46e39 commit 02898b4
Showing 1 changed file with 16 additions and 14 deletions.
30 changes: 16 additions & 14 deletions assets/components/importx/js/mgr/widget.home.form.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,21 +31,23 @@ importX.page.createImport = function(config) {
process: 'import',
text: _('importx.startbutton'),
handler: function() {
if (this.console === null || typeof this.console === 'undefined') {
this.console = MODx.load({
xtype: 'modx-console'
,register: register
,topic: topic
,show_filename: 0
,listeners: {
'shutdown': {fn:function() {
Ext.getCmp('modx-layout').refreshTrees();
},scope:this}
}
});
} else {
this.console.setRegister(register, topic);
// Destroy any previously loaded console, so we can load a fresh one without errors.
if (typeof this.console !== 'undefined') {
this.console.destroy();
}

this.console = MODx.load({
xtype: 'modx-console'
,register: register
,topic: topic
,show_filename: 0
,listeners: {
'shutdown': {fn:function() {
Ext.getCmp('modx-layout').refreshTrees();
},scope:this}
}
});

this.console.show(Ext.getBody());
Ext.getCmp('importx-panel-import').form.submit({
success:{fn:function() {
Expand Down

0 comments on commit 02898b4

Please sign in to comment.