-
-
Notifications
You must be signed in to change notification settings - Fork 824
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
core#1398: Option to open navigation item in new window (if present) #15861
Conversation
(Standard links)
|
jenkins, test this please |
js/crm.menubar.js
Outdated
@@ -411,7 +411,7 @@ | |||
branchTpl: | |||
'<% _.forEach(items, function(item) { %>' + | |||
'<li <%= attr("li", item) %>>' + | |||
'<a <%= attr("a", item) %>>' + | |||
'<a <%= attr("a", item) %> <% if (item.target) { %>target=<%- item.target %><% } %>>' + |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking at the attr()
function, maybe instead of patching this line you could do this:
diff --git a/js/crm.menubar.js b/js/crm.menubar.js
index 152a6e376e..9fa49f63d6 100644
--- a/js/crm.menubar.js
+++ b/js/crm.menubar.js
@@ -471,7 +471,7 @@
}
function attr(el, item) {
- var ret = [], attr = _.cloneDeep(item.attr || {}), a = ['rel', 'accesskey'];
+ var ret = [], attr = _.cloneDeep(item.attr || {}), a = ['rel', 'accesskey', 'target'];
if (el === 'a') {
attr = _.pick(attr, a);
attr.href = item.url || "#";
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@monishdeb any thoughts?
Thanks @colemanw for suggesting the tweak, about how we can use existing |
Yes @monishdeb that looks right. Can you squash this PR please? |
done :) |
FYI @monishdeb I tried to find where the function is used that you referenced in this PR description... and it's not. So I've filed #15956 |
Unrelated fail |
Overview
Currently, the
target
attribute of submenus are ignored whereas the menu item adds this property in the anchor links hereBefore
The
target
attribute was ignored even if added using navigationMenu hookAfter
The
target
atrribute is not ignored for (existing/new) sub-menu itemsComments
ping @colemanw @lcdservices @eileenmcnaughton