From 0d64ba1f45d38f047957163880d1c85b9e887131 Mon Sep 17 00:00:00 2001 From: "waleed.mujahid" Date: Mon, 24 Nov 2025 20:40:11 +0500 Subject: [PATCH] feat: ensure dialog closes properly when saving Previously when a user clicked on the save button the page would reload and the dialog would reopen. This would also cause the block to become unresponsive. This PR fixes the flow so dialog is closed properly --- audio/static/js/src/audio_edit.js | 1 + setup.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/audio/static/js/src/audio_edit.js b/audio/static/js/src/audio_edit.js index 42a7543..440cb0f 100644 --- a/audio/static/js/src/audio_edit.js +++ b/audio/static/js/src/audio_edit.js @@ -5,6 +5,7 @@ function AudioEditBlock(runtime, element) { src: $(element).find('input[name=audio_src]').val() }; $.post(handlerUrl, JSON.stringify(data)).done(function(response) { + runtime.notify('save', {state: 'end'}) window.location.reload(false); }); }); diff --git a/setup.py b/setup.py index 6dad532..fb9175d 100644 --- a/setup.py +++ b/setup.py @@ -120,7 +120,7 @@ def is_requirement(line): setup( name='audio-xblock', - version='0.3.1', + version='0.3.2', description='Audio XBlock, to play audio files in the course', long_description=README, long_description_content_type='text/markdown',