From d3a925be4530b0294c22074023745beb028cd9bb Mon Sep 17 00:00:00 2001 From: PKulkoRaccoonGang Date: Tue, 7 May 2024 13:38:49 +0300 Subject: [PATCH] refactor: after review --- cms/djangoapps/contentstore/views/block.py | 4 +++- cms/static/js/views/modals/base_modal.js | 2 +- cms/static/js/views/modals/edit_xblock.js | 4 ++-- cms/static/js/views/utils/move_xblock_utils.js | 2 +- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/cms/djangoapps/contentstore/views/block.py b/cms/djangoapps/contentstore/views/block.py index 2789ed2ce5ca..46e49c2fae4a 100644 --- a/cms/djangoapps/contentstore/views/block.py +++ b/cms/djangoapps/contentstore/views/block.py @@ -307,7 +307,9 @@ def xblock_view_handler(request, usage_key_string, view_name): @login_required def xblock_actions_view(request, usage_key_string, action_name): """ - The handler for rendered edit xblock view. + Return rendered xblock action view. + The action name should be provided as an argument. + Valid options for action names are edit and move. """ usage_key = usage_key_with_run(usage_key_string) if not has_studio_read_access(request.user, usage_key.course_key): diff --git a/cms/static/js/views/modals/base_modal.js b/cms/static/js/views/modals/base_modal.js index 4d4ecc99f401..828289533a73 100644 --- a/cms/static/js/views/modals/base_modal.js +++ b/cms/static/js/views/modals/base_modal.js @@ -120,7 +120,7 @@ define(['jquery', 'underscore', 'gettext', 'js/views/baseview'], event.stopPropagation(); // Make sure parent modals don't see the click } window.parent.postMessage({ - method: 'close_edit_modal', + method: 'close_modal', msg: 'Sends a message when the modal window is closed' }, '*'); this.hide(); diff --git a/cms/static/js/views/modals/edit_xblock.js b/cms/static/js/views/modals/edit_xblock.js index 5ab9809b6a9d..0ced05cea737 100644 --- a/cms/static/js/views/modals/edit_xblock.js +++ b/cms/static/js/views/modals/edit_xblock.js @@ -209,8 +209,8 @@ function($, _, Backbone, gettext, BaseModal, ViewUtils, XBlockViewUtils, XBlockE Backbone.trigger('xblock:editorModalHidden'); window.parent.postMessage({ - method: 'close_edit_modal', - msg: 'Sends a message when the modal window is closed' + method: 'close_modal', + msg: 'Sends a message when the edit modal window is closed' }, '*'); BaseModal.prototype.hide.call(this); diff --git a/cms/static/js/views/utils/move_xblock_utils.js b/cms/static/js/views/utils/move_xblock_utils.js index 178185fe6b73..f3bcc675f1da 100644 --- a/cms/static/js/views/utils/move_xblock_utils.js +++ b/cms/static/js/views/utils/move_xblock_utils.js @@ -41,7 +41,7 @@ function($, _, Backbone, Feedback, AlertView, XBlockViewUtils, MoveXBlockUtils, } }, '*'); window.parent.postMessage({ - method: 'close_edit_modal', + method: 'close_modal', msg: 'Sends a message when the modal window is closed' }, '*');