Pass correct "context" object to openDialog

Change-Id: I236fc93d5c58542a9b935894ab1e4f99663bd734
This commit is contained in:
Ed Sanders 2024-11-15 11:23:56 +00:00
parent 24dd704bb0
commit c56593d4c6

View file

@ -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 );
} );
} );