Skip to content

Commit

Permalink
Merge 3d3fb11 into 7a497df
Browse files Browse the repository at this point in the history
  • Loading branch information
crydotsnake committed Apr 2, 2022
2 parents 7a497df + 3d3fb11 commit be1c0da
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 8 deletions.
16 changes: 8 additions & 8 deletions cms/cms_toolbars.py
Expand Up @@ -50,12 +50,12 @@
SHORTCUTS_BREAK = 'Shortcuts Break'

DEFAULT_HELP_MENU_ITEMS = (
(gettext("Getting started developer guide"), 'https://docs.django-cms.org/en/latest/introduction/index.html'),
(gettext("Documentation"), 'https://docs.django-cms.org/en/latest/'),
(gettext("User guide"), 'https://docs.google.com/document/d/1f5eWyD_sxUSok436fSqDI0NHcpQ88CXQoDoQm9ZXb0s/'),
(gettext("Support Forum"), 'https://discourse.django-cms.org/'),
(gettext("Support Slack"), 'https://www.django-cms.org/slack'),
(gettext("What's new"), 'https://www.django-cms.org/en/blog/'),
(gettext("Getting started developer guide"), 'https://docs.django-cms.org/en/latest/introduction/index.html', True),
(gettext("Documentation"), 'https://docs.django-cms.org/en/latest/', True),
(gettext("User guide"), 'https://docs.google.com/document/d/1f5eWyD_sxUSok436fSqDI0NHcpQ88CXQoDoQm9ZXb0s/', True),
(gettext("Support Forum"), 'https://discourse.django-cms.org/', True),
(gettext("Support Slack"), 'https://www.django-cms.org/slack', True),
(gettext("What's new"), 'https://www.django-cms.org/en/blog/', True),
)


Expand Down Expand Up @@ -231,8 +231,8 @@ def add_help_menu(self):
if get_cms_setting('ENABLE_HELP'):
self._help_menu = self.toolbar.get_or_create_menu(HELP_MENU_IDENTIFIER, _('Help'), position=-1)
self._help_menu.items = [] # reset the items so we don't duplicate
for label, url in DEFAULT_HELP_MENU_ITEMS:
self._help_menu.add_link_item(label, url=url)
for label, url, external in DEFAULT_HELP_MENU_ITEMS:
self._help_menu.add_link_item(label, url=url, extra_classes=['js-external-link',])

extra_menu_items = get_cms_setting('EXTRA_HELP_MENU_ITEMS')
if extra_menu_items:
Expand Down
9 changes: 9 additions & 0 deletions cms/static/cms/js/modules/cms.toolbar.js
Expand Up @@ -759,4 +759,13 @@ var Toolbar = new Class({
}
});

$(function(){
$(document).on("click",".js-external-link",function(e){
e.preventDefault();
var el = $(this);
var url = el.attr("href");
window.open(url);
});
});

export default Toolbar;

0 comments on commit be1c0da

Please sign in to comment.