Feature: Detachable Editor

Created on 2 October 2024, 3 months ago

Problem/Motivation

It would be nice to be able to detach the editor window to work in a multi-screen setup.
This would allow an even better, unobstructed, preview of the adjusted content.

Proposed resolution

I think we can get pretty far by just opening the editor in a new window and use window.opener and window.name to adjust the behavior of the preview handling

Remaining tasks

  • Write code
  • Reviews
  • Can we test this in a sane way?

User interface changes

  • New button in editor dialog to detach / re-attach editor

API changes

none

Data model changes

none

Feature request
Status

Needs work

Version

2.0

Component

Code

Created by

🇨🇭Switzerland das-peter

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @das-peter
  • Merge request !84Issue #3478211: Feature: Detachable Editor → (Open) created by das-peter
  • Pipeline finished with Success
    3 months ago
    Total: 133s
    #298783
  • 🇨🇭Switzerland das-peter

    I've created a POC which mostly works already.
    Only downside atm. is that a editor re-attach won't update the content in the attached editor.

  • Pipeline finished with Success
    3 months ago
    Total: 141s
    #299664
  • 🇩🇪Germany a.dmitriiev

    Interesting feature request. Thank you. I will check this soon.

  • 🇩🇪Germany a.dmitriiev

    I am checking this now, and there is one more problem. If some changes were done and then user clicks "Detach Editor", all the changes that were done in sidebar are not displayed in the detached editor. So the problem exists in both directions.

  • 🇩🇪Germany a.dmitriiev

    I made a setting "Allow detach" to enable/disable detach button here /admin/config/frontend-editing. Also I moved the js code to its own Drupal library not to mix it with preview.js. I have found the way to preserve changes done in sidebar when detaching window and other way round. This can be achieved with https://www.drupal.org/project/all_entity_preview module. This module is already integrated with frontend editing for preview of the changes. I am not sure that there is any reliable way to do this with pure JS. When the "All entity preview" module is not installed there is a warning near the "Detach editor" button.

    Please review my changes. Be aware by default the "Detach editor" button is disabled, you need to enable it here /admin/config/frontend-editing.

  • 🇩🇪Germany hanan alasari kassel

    I confirm that i could to be able to detach the editor window, and works fine with the automatic preview.

    just want to mention this, in the window when i select automatic preview, any element can be edited automatically, except the title field, may

    be we need to add the title block to the frontend editing settings?

  • 🇩🇪Germany a.dmitriiev

    Thank you @hanan alasari for a review. Unfortunately the issue with node title is a problem that was also before this feature. I will create a separate issue for it. Let's focus here on detachable feature.

Production build 0.71.5 2024