Skip to content

Commit 1bd5dfb

Browse files
committed
Revert "fix: simplify asset copy button behavior by removing some logic"
This reverts commit 09154ef. Signed-off-by: F.N. Claessen <[email protected]>
1 parent 09154ef commit 1bd5dfb

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

flexmeasures/ui/static/js/ui-utils.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -376,6 +376,7 @@ export function initCopyAssetButtons() {
376376
const targetAccountId = btn.dataset.targetAccountId || null;
377377

378378
btn.addEventListener("click", function (event) {
379+
const openInNewTab = event.ctrlKey || event.metaKey;
379380
const url = targetAccountId
380381
? "/api/v3_0/assets/" + assetId + "/copy?account=" + targetAccountId
381382
: "/api/v3_0/assets/" + assetId + "/copy";
@@ -387,7 +388,11 @@ export function initCopyAssetButtons() {
387388
showToast("Asset copied successfully.", "success");
388389
setTimeout(() => {
389390
const dest = "/assets/" + data.asset + "/properties";
390-
window.open(dest, "_blank");
391+
if (openInNewTab) {
392+
window.open(dest, "_blank");
393+
} else {
394+
window.location.href = dest;
395+
}
391396
}, 1500);
392397
}),
393398
"Failed to copy asset"

0 commit comments

Comments
 (0)