Skip to content

Commit

Permalink
Fixed the issue that the annotation delete functionality on annotatio…
Browse files Browse the repository at this point in the history
…n popup menu broke.
  • Loading branch information
JasoxLee committed Mar 9, 2021
1 parent bdd7819 commit b1dd330
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
19 changes: 18 additions & 1 deletion apps/viewer/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -238,12 +238,29 @@ function initCore() {
// statements_def
break;
}

$UI.annotPopup.data = {
id: data.provenance.analysis.execution_id,
oid: data._id.$oid,
annotation: attributes,
selected: e.data.selected,
};
const getCateName = () => {
const items = $UI.layersViewer.setting.categoricalData.human.items;
var dataType = null;
for(const key in items){
dataType = key;
if (items.hasOwnProperty(key)&&Array.isArray(items[key].items)&&items[key].items.some(i=>i.item.id == $UI.annotPopup.data.id)) break;
}
return dataType;
}



$UI.annotPopup.dataType = null;
$UI.annotPopup.dataType = data.provenance && data.provenance.analysis && data.provenance.analysis.source && data.provenance.analysis.source=='human'?
getCateName($UI.annotPopup.data.id):null;

$UI.annotPopup.setTitle(`id:${data.provenance.analysis.execution_id}`);
$UI.annotPopup.setBody(body);
if (warning) $UI.annotPopup.body.innerHTML += warning;
Expand Down Expand Up @@ -961,7 +978,7 @@ function addHumanLayerItems() {
false;
var isFind = false;
for (const key in items) {
if (d.id.includes(key)) {
if (d.id.includes(`${key}_`)) {
isFind = true;
items[key].items.push({item: d, isShow});
}
Expand Down
2 changes: 1 addition & 1 deletion components/popuppanel/popuppanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ PopupPanel.createBtn = function(parent, opt, thisArg = null) {
btn.classList.add(opt.class);
btn.textContent = opt.text;
btn.addEventListener('click', function(e) {
opt.callback.call(null, thisArg.data);
opt.callback.call(null, thisArg.data, thisArg.dataType);
});
parent.appendChild(btn);
return btn;
Expand Down

0 comments on commit b1dd330

Please sign in to comment.