Skip to content

Commit 6804471

Browse files
authored
Merge branch '5.4-dev' into 5.4-dev-update-browserlist-2026-02-17
2 parents 6c0a05d + 42d310a commit 6804471

File tree

3 files changed

+35
-36
lines changed

3 files changed

+35
-36
lines changed

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Pull Request for Issue # .
1+
Pull Request resolves # .
22

33
### Summary of Changes
44

administrator/components/com_content/tmpl/articles/default.php

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -167,23 +167,26 @@
167167
$canEditOwnParCat = $user->authorise('core.edit.own', 'com_content.category.' . $item->parent_category_id) && $item->parent_category_uid == $userId;
168168

169169
// Transition button options
170-
$options = [
171-
'title' => Text::_($item->stage_title),
172-
'tip_content' => Text::sprintf('JWORKFLOW', Text::_($item->workflow_title)),
173-
'id' => 'workflow-' . $item->id,
174-
'task' => 'articles.runTransition',
175-
'disabled' => !$canExecuteTransition,
176-
];
170+
if ($workflow_enabled) {
171+
$options = [
172+
'title' => Text::_($item->stage_title),
173+
'tip_content' => Text::sprintf('JWORKFLOW', Text::_($item->workflow_title)),
174+
'id' => 'workflow-' . $item->id,
175+
'task' => 'articles.runTransition',
176+
'disabled' => !$canExecuteTransition,
177+
];
178+
$dataTransitionsAttribute = '';
177179

178-
if ($canExecuteTransition) {
179-
$transitions = ContentHelper::filterTransitions($this->transitions, (int) $item->stage_id, (int) $item->workflow_id);
180+
if ($canExecuteTransition) {
181+
$transitions = ContentHelper::filterTransitions($this->transitions, (int) $item->stage_id, (int) $item->workflow_id);
180182

181-
$transition_ids = ArrayHelper::getColumn($transitions, 'value');
182-
$transition_ids = ArrayHelper::toInteger($transition_ids);
183+
$transition_ids = ArrayHelper::getColumn($transitions, 'value');
184+
$transition_ids = ArrayHelper::toInteger($transition_ids);
183185

184-
$dataTransitionsAttribute = 'data-transitions="' . implode(',', $transition_ids) . '"';
186+
$dataTransitionsAttribute = $transition_ids ? 'data-transitions="' . implode(',', $transition_ids) . '"' : '';
185187

186-
$options = array_merge($options, ['transitions' => $transitions]);
188+
$options = array_merge($options, ['transitions' => $transitions]);
189+
}
187190
}
188191

189192
?>

build/media_source/plg_editors_tinymce/js/tinymce.es6.js

Lines changed: 18 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -197,30 +197,26 @@ Joomla.JoomlaTinyMCE = {
197197
// Work around iframe behavior, when iframe element changes location in DOM and losing its content.
198198
// Re init editor when iframe is reloaded.
199199
if (!ed.inline) {
200-
let isReady = false;
201-
let isRendered = false;
202-
const listenIframeReload = () => {
200+
// Make sure iframe is fully loaded. This works differently in different browsers,
201+
// so have to listen both "load" and "init" events and set our listener in the last one triggered.
202+
let listenersCounter = 2;
203+
const checkInitIsCompleted = () => {
204+
listenersCounter--;
205+
// Make sure all listeners were executed. The last call is when the TinyMCE is fully initialized.
206+
if (listenersCounter) return;
203207
const $iframe = ed.getContentAreaContainer().querySelector('iframe');
204-
205-
$iframe.addEventListener('load', () => {
206-
debounceReInit(ed, element, pluginOptions);
207-
});
208-
};
209-
210-
// Make sure iframe is fully loaded.
211-
// This works differently in different browsers, so have to listen both "load" and "PostRender" events.
212-
ed.on('load', () => {
213-
isReady = true;
214-
if (isRendered) {
215-
listenIframeReload();
208+
if ($iframe.contentDocument.readyState !== 'complete') {
209+
// Initialisation were completed. However, the iframe still not loaded. Wait for that. Say Hello to Firefox Developer edition.
210+
$iframe.onload = () => {
211+
$iframe.onload = null;
212+
$iframe.addEventListener('load', () => debounceReInit(ed, element, pluginOptions));
213+
};
214+
} else {
215+
$iframe.addEventListener('load', () => debounceReInit(ed, element, pluginOptions));
216216
}
217-
});
218-
ed.on('PostRender', () => {
219-
isRendered = true;
220-
if (isReady) {
221-
listenIframeReload();
222-
}
223-
});
217+
};
218+
ed.on('load', checkInitIsCompleted);
219+
ed.on('init', checkInitIsCompleted);
224220
}
225221

226222
// Find out when editor is interacted

0 commit comments

Comments
 (0)