From c56593d4c62b9e7ed4e79b129a3da9bcec790010 Mon Sep 17 00:00:00 2001 From: Ed Sanders Date: Fri, 15 Nov 2024 11:23:56 +0000 Subject: [PATCH] Pass correct "context" object to openDialog Change-Id: I236fc93d5c58542a9b935894ab1e4f99663bd734 --- modules/jquery.wikiEditor.dialogs.config.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/jquery.wikiEditor.dialogs.config.js b/modules/jquery.wikiEditor.dialogs.config.js index 8531cebd..7a47e528 100644 --- a/modules/jquery.wikiEditor.dialogs.config.js +++ b/modules/jquery.wikiEditor.dialogs.config.js @@ -465,11 +465,12 @@ module.exports = { windowManager.addWindows( [ uploadDialog ] ); windowManager.openWindow( uploadDialog ); - uploadDialog.uploadBooklet.on( 'fileSaved', function ( imageInfo ) { + uploadDialog.uploadBooklet.on( 'fileSaved', ( imageInfo ) => { uploadDialog.close(); windowManager.$element.remove(); - $.wikiEditor.modules.dialogs.api.openDialog( this, 'insert-file' ); + const context = $( this ).data( 'context' ); + $.wikiEditor.modules.dialogs.api.openDialog( context, 'insert-file' ); $( '#wikieditor-toolbar-file-target' ).val( imageInfo.canonicaltitle ); } ); } );