File tree Expand file tree Collapse file tree
flexmeasures/ui/static/js Expand file tree Collapse file tree Original file line number Diff line number Diff 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"
You can’t perform that action at this time.
0 commit comments