Skip to content

Commit

Permalink
Ensure forms within CKEditor 5 modals aren't processed for sticky act…
Browse files Browse the repository at this point in the history
…ions.
  • Loading branch information
laryn committed Sep 17, 2024
1 parent a4f5be4 commit 653cb6b
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions dist/js/more_actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ $ = jQuery, Backdrop.behaviors.ginFormActions = {
init: function(context, settings) {
const actionsFormId = settings.Gin.actions_form_id;
$("#backdrop-modal form").once("ginEditModalForm").addClass("gin-edit-modal-form"),
$("#ckeditor5-modal form").once("ginEditModalForm").addClass("gin-edit-modal-form"),
$("#" + actionsFormId + ":not(.gin-edit-modal-form)").once("ginEditForm").each((function() {
$(".form-actions input", this).attr("form", actionsFormId), $("body > .layout > .region-sticky .block-page-title-block").append($(".form-actions", this));
})), $(".gin-more-actions__trigger").once("ginMoreActionsToggle").each((function(el) {
Expand Down
1 change: 1 addition & 0 deletions dist/js/sidebar.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
init: function(context, settings) {
const hideLabel = Backdrop.t("Hide sidebar panel"), sidebarFormId = settings.Gin.sidebar_form_id, actionsFormId = settings.Gin.actions_form_id, sidebarToggler = '<a href="#toggle-sidebar" class="meta-sidebar__trigger trigger" role="button" title="' + hideLabel + '" aria-controls="gin_sidebar"><span class="visually-hidden">' + hideLabel + "</span></a>";
$("#backdrop-modal form").once("ginEditModalForm").addClass("gin-edit-modal-form"),
$("#ckeditor5-modal form").once("ginEditModalForm").addClass("gin-edit-modal-form"),
$("#" + sidebarFormId + ":not(.gin-edit-modal-form)").once("gin-sidebar").each((function() {
$("> div:first-child", this).addClass("layout-region-node-main"), actionsFormId ? $(".region-sticky .form-actions").prepend(sidebarToggler) : $(".form-actions", this).append(sidebarToggler),
$(this).append('<div id="gin_sidebar" class="layout-region-node-secondary"><span class="gin-sidebar-draggable" id="gin-sidebar-draggable"></span></div>'),
Expand Down
1 change: 1 addition & 0 deletions js/more_actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
init: function (context, settings) {
const actionsFormId = settings.Gin.actions_form_id;
$('#backdrop-modal form').once('ginEditModalForm').addClass('gin-edit-modal-form');
$('#ckeditor5-modal form').once('ginEditModalForm').addClass('gin-edit-modal-form');
$('#' + actionsFormId + ':not(.gin-edit-modal-form)').once('ginEditForm').each(function () {
// Sync form ID.
// Backdrop.ginStickyFormActions.updateFormId(newParent, $(this).attr('id'));
Expand Down
1 change: 1 addition & 0 deletions js/sidebar.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
const actionsFormId = settings.Gin.actions_form_id;
const sidebarToggler = '<a href="#toggle-sidebar" class="meta-sidebar__trigger trigger" role="button" title="' + hideLabel + '" aria-controls="gin_sidebar"><span class="visually-hidden">' + hideLabel + '</span></a>';
$('#backdrop-modal form').once('ginEditModalForm').addClass('gin-edit-modal-form');
$("#ckeditor5-modal form").once("ginEditModalForm").addClass("gin-edit-modal-form"),
$('#' + sidebarFormId + ':not(.gin-edit-modal-form)').once('gin-sidebar').each(function () {
$('> div:first-child', this).addClass('layout-region-node-main');

Expand Down

0 comments on commit 653cb6b

Please sign in to comment.