Skip to content

Commit

Permalink
Fixed Options and link dropdown
Browse files Browse the repository at this point in the history
  • Loading branch information
as0050629 committed Jun 28, 2024
1 parent 66efa37 commit b385f45
Showing 1 changed file with 42 additions and 37 deletions.
79 changes: 42 additions & 37 deletions geoportal/src/main/webapp/app/search/ItemCard.js
Original file line number Diff line number Diff line change
Expand Up @@ -319,42 +319,45 @@ function(declare, lang, array, string, topic, xhr, on, appTopics, domStyle, domC
});
itemHtml.show();
},

_renderLinksDropdown: function(item,links) {
if (links.length === 0) return;
var dd = domConstruct.create("div",{
"class": "dropdown",
"style": "display:inline-block;"
},this.actionsNode);
var ddbtn = domConstruct.create("a",{
"class": "dropdown-toggle",
"href": "javascript:void(0)",
"data-toggle": "dropdown",
"aria-haspopup": true,
"aria-expanded": true,
title: string.substitute(i18n.item.actions.titleFormat, {action: i18n.item.actions.links, title: item.title}),
"aria-label": string.substitute(i18n.item.actions.titleFormat, {action: i18n.item.actions.links, title: item.title}),
innerHTML: i18n.item.actions.links
},dd);
domConstruct.create("span",{
"class": "caret"
},ddbtn);
var ddul = domConstruct.create("ul",{
"class": "dropdown-menu",
},dd);
array.forEach(links, function(u){
var ddli = domConstruct.create("li",{},ddul);
domConstruct.create("a",{
"class": "small",
href: u,
target: "_blank",
title: string.substitute(i18n.item.actions.titleFormat, {action: u, title: item.title}),
"aria-label": string.substitute(i18n.item.actions.titleFormat, {action: u, title: item.title}),
innerHTML: u
},ddli);
});
this._mitigateDropdownClip(dd,ddul);
},
var dd = domConstruct.create("div",{
"class": "dropdown"
},this.actionsNode);

var ddbtn = domConstruct.create("a",{
"class": "dropdown-toggle",
"href": "javascript:void(0)",
"id":"dropdownMenuLink",
"data-bs-toggle": "dropdown",
"aria-expanded": false,
"title": string.substitute(i18n.item.actions.titleFormat, {action: i18n.item.actions.links, title: item.title}),
"aria-label": string.substitute(i18n.item.actions.titleFormat, {action: i18n.item.actions.links, title: item.title}),
innerHTML: i18n.item.actions.links
},dd);

domConstruct.create("span",{
"class": "caret"
},ddbtn);

var ddul = domConstruct.create("ul",{
"class": "dropdown-menu",
"aria-labelledby":"dropdownMenuLink"
},dd);

array.forEach(links, function(u){
var ddli = domConstruct.create("li",{},ddul);
domConstruct.create("a",{
"class": "small",
href: u,
target: "_blank",
title: string.substitute(i18n.item.actions.titleFormat, {action: u, title: item.title}),
"aria-label": string.substitute(i18n.item.actions.titleFormat, {action: u, title: item.title}),
innerHTML: u
},ddli);
});
// this._mitigateDropdownClip(dd,ddul);
},


_renderOptionsDropdown: function(itemId,item) {
var self = this;
Expand Down Expand Up @@ -508,7 +511,8 @@ function(declare, lang, array, string, topic, xhr, on, appTopics, domStyle, domC
var ddbtn = domConstruct.create("a",{
"class": "dropdown-toggle",
"href": "javascript:void(0)",
"data-toggle": "dropdown",
"id":"optionsDropdownMenuLink",
"data-bs-toggle": "dropdown",
"aria-haspopup": true,
"aria-expanded": true,
innerHTML: i18n.item.actions.options.caption
Expand All @@ -518,12 +522,13 @@ function(declare, lang, array, string, topic, xhr, on, appTopics, domStyle, domC
},ddbtn);
var ddul = domConstruct.create("ul",{
"class": "dropdown-menu",
"aria-labelledby":"optionsDropdownMenuLink"
},dd);
array.forEach(links,function(link){
var ddli = domConstruct.create("li",{},ddul);
ddli.appendChild(link);
});
this._mitigateDropdownClip(dd,ddul);
//this._mitigateDropdownClip(dd,ddul);
},

_renderOwnerAndDate: function(item) {
Expand Down

0 comments on commit b385f45

Please sign in to comment.