Skip to content

Commit

Permalink
Added data-popup attr to a tag (#291)
Browse files Browse the repository at this point in the history
  • Loading branch information
vipulnarang95 authored Nov 25, 2024
1 parent c30c490 commit 2702238
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Changelog

Unreleased
==========
fix: Add data-popup attr to a tag in burger menu item
fix: Replace SortableAdminMixin by SortableAdminBase for WorkflowAdmin
fix: Restore "In Collection" button in the toolbar

Expand Down
5 changes: 5 additions & 0 deletions djangocms_moderation/static/djangocms_moderation/js/burger.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@
let li_anchor = document.createElement('a');
const itemId = $(item).attr('id');
const itemTarget = $(item).attr('target');
const itemDataPopup = $(item).attr('data-popup');

li_anchor.setAttribute('class', 'cms-actions-dropdown-menu-item-anchor');
li_anchor.setAttribute('href', $(item).attr('href'));
Expand All @@ -158,6 +159,10 @@
if (itemTarget !== undefined) {
li_anchor.setAttribute('target', itemTarget);
}
// Copy the data-popup attribute if it is set
if (itemDataPopup !== undefined) {
li_anchor.setAttribute('data-popup', itemDataPopup);
}

if ($(item).hasClass('cms-form-get-method')) {
// Ensure the fake-form selector is propagated to the new anchor
Expand Down

0 comments on commit 2702238

Please sign in to comment.