@@ -114,6 +114,9 @@ class Item extends LitElement {
114
114
@property ( { type : String } )
115
115
sourceUrl : string | null = null ;
116
116
117
+ @property ( { type : String } )
118
+ downloadUrl : string | null = null ;
119
+
117
120
@property ( { type : Object , attribute : false } )
118
121
loadInfo : LoadInfo | null = null ;
119
122
@@ -445,8 +448,16 @@ class Item extends LitElement {
445
448
} ) ;
446
449
}
447
450
448
- if ( ! this . itemInfo ! . title ) {
449
- this . itemInfo ! . title = this . itemInfo ! . filename ;
451
+ const { title, name, filename, downloadUrl } = this . itemInfo ! ;
452
+
453
+ if ( ! title ) {
454
+ this . itemInfo ! . title = name || filename ;
455
+ }
456
+
457
+ if ( downloadUrl === null ) {
458
+ this . downloadUrl = null ;
459
+ } else {
460
+ this . downloadUrl = downloadUrl || this . sourceUrl ;
450
461
}
451
462
452
463
if ( this . embed === "replayonly" || this . embed === "replay-with-info" ) {
@@ -1349,11 +1360,11 @@ class Item extends LitElement {
1349
1360
< span > Purge Cache + Full Reload</ span >
1350
1361
</ a > `
1351
1362
: html `` }
1352
- ${ ( ! this . editable && this . sourceUrl ?. startsWith ( "http://" ) ) ||
1353
- this . sourceUrl ?. startsWith ( "https://" )
1363
+ ${ ( ! this . editable && this . downloadUrl ?. startsWith ( "http://" ) ) ||
1364
+ this . downloadUrl ?. startsWith ( "https://" )
1354
1365
? html ` < hr class ="dropdown-divider " />
1355
1366
< a
1356
- href ="${ this . sourceUrl } "
1367
+ href ="${ this . downloadUrl } "
1357
1368
role ="button "
1358
1369
class ="dropdown-item "
1359
1370
@keyup ="${ clickOnSpacebarPress } "
@@ -1375,24 +1386,25 @@ class Item extends LitElement {
1375
1386
< span class ="menu-head "> Capture Date</ span > ${ dateStr }
1376
1387
</ div > `
1377
1388
: "" }
1378
- ${ ! this . editable
1389
+ ${ ! this . editable &&
1390
+ ( this . downloadUrl === this . sourceUrl || ! this . embed )
1379
1391
? html ` < a
1380
- href ="# "
1381
- role ="button "
1382
- class ="dropdown-item "
1383
- @click ="${ this . onShowInfoDialog } "
1384
- >
1385
- < span class ="icon is-small ">
1386
- < fa-icon
1387
- class ="has-text-grey "
1388
- aria-hidden ="true "
1389
- .svg ="${ fasInfoIcon } "
1390
- > </ fa-icon >
1391
- </ span >
1392
- < span > Archive Info</ span >
1393
- </ a >
1394
- < hr class ="dropdown-divider " /> `
1392
+ href ="# "
1393
+ role ="button "
1394
+ class ="dropdown-item "
1395
+ @click ="${ this . onShowInfoDialog } "
1396
+ >
1397
+ < span class ="icon is-small ">
1398
+ < fa-icon
1399
+ class ="has-text-grey "
1400
+ aria-hidden ="true "
1401
+ .svg ="${ fasInfoIcon } "
1402
+ > </ fa-icon >
1403
+ </ span >
1404
+ < span > Archive Info</ span >
1405
+ </ a > `
1395
1406
: `` }
1407
+ < hr class ="dropdown-divider " />
1396
1408
< a
1397
1409
href ="# "
1398
1410
role ="button "
0 commit comments