Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added data-popup attr to a tag #291

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading