Skip to content

fix: show Edit button in popup/new/open/frame display modes#46

Open
erseco wants to merge 2 commits intomainfrom
43-cant-edit-content-in-popup-or-new-window
Open

fix: show Edit button in popup/new/open/frame display modes#46
erseco wants to merge 2 commits intomainfrom
43-cant-edit-content-in-popup-or-new-window

Conversation

@erseco
Copy link
Copy Markdown
Collaborator

@erseco erseco commented Apr 29, 2026

Summary

Fixes #43.

  • Render the mod_exeweb/action_bar template (which carries the eXeLearning Online / embedded editor Edit button) in exeweb_print_workaround() and in the FRAME-mode top frame. Previously the Edit button only existed in embed_general.mustache, so any teacher whose activity used In popup / Open / New window / In frame had no way to edit the package from the activity view.
  • Make the embedded editor modal attach to the topmost same-origin window. When the Edit button is invoked from inside a small frame (e.g. the FRAME-mode top frame or another embedded iframe), the overlay was created inside that cramped frame, which is what the issue describes as the dialog getting "stuck at the bottom and hard to close". The modal now spans the full viewport.

Test plan

  • In a course as a teacher, create an exeweb activity with Display = In pop-up and confirm the Edit button is visible on the activity view and opens the editor modal.
  • Repeat with Display = New window.
  • Repeat with Display = Open.
  • Repeat with Display = In frame: Edit button appears in the top frame; opening it shows a full-viewport editor modal whose Save/Close buttons are clickable.
  • Confirm Display = Embed still works as before.
  • Confirm a non-editing user (student) does not see the Edit button in any mode.

Moodle Playground Preview

The changes in this pull request can be previewed and tested using a Moodle Playground instance.

Preview in Moodle Playground

⚠️ The embedded eXeLearning editor is not included in this preview. You can install it from Modules > eXeLearning Web > Configure using the "Download & Install Editor" button. All other module features (ELPX upload, viewer, preview) work normally.

For Display modes other than Embed, view.php delegated to
exeweb_print_workaround() / exeweb_display_frame(), which never rendered
the action_bar template. Teachers therefore had no Edit button and
could only view the package.

Render the action_bar in both code paths so the Edit (online or
embedded editor) action is available in every Display mode.

Also make the embedded editor modal attach to the topmost same-origin
window. When the Edit button is clicked from inside a small frame
(FRAME mode top frame, or any embedded iframe context), the overlay
previously rendered inside the cramped frame and got stuck near the
bottom with the close button out of reach. The modal now spans the
full viewport.

Refs #43
Copy link
Copy Markdown
Collaborator

@ignaciogros ignaciogros left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the "Iframe" options, the fullscreen and the "Edit in eXeLearning" button are not working.

I don’t really see what this option adds, because "Embed" also uses an iframe. Should we remove it?

If we decide to keep it, I'llfix a few minor presentation issues once the functionality is fixed.

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Can't edit content in popup or new window

2 participants