Skip to content

Commit 202bbc1

Browse files
committed
fix media resolving on editor switch
When switching editors, the current ID needs to be passed to the Ajax call or media resolving for relative links will fail.
1 parent e28ccbf commit 202bbc1

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

action/ajax.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,8 @@ public function switchEditors(Event $event)
143143
$event->preventDefault();
144144
$event->stopPropagation();
145145

146-
global $INPUT;
146+
global $INPUT, $ID;
147+
$ID = $INPUT->str('id');
147148

148149
if ($INPUT->bool('getJSON')) {
149150
$text = $INPUT->str('data');

script.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ function toggleEditor() {
122122
call: 'plugin_prosemirror_switch_editors',
123123
data: window.proseMirrorIsActive ? $jsonField.val() : $textArea.val(),
124124
getJSON: window.proseMirrorIsActive ? '0' : '1',
125+
id: JSINFO.id
125126
}).done(function handleSwitchEditorResponse(data) {
126127
if (window.proseMirrorIsActive) {
127128
showDefaultEditor(data.text);

0 commit comments

Comments
 (0)