@@ -453,12 +453,16 @@ export class ItemView extends PageUtility {
453453 Getters . StoredItem . getSingleStoredForItem ( itemId , async function ( stored ) {
454454 let promises = [ ] ;
455455 let storageLabel = $ ( `
456- <h3>
457- Stored in: <span class="uniqueItemStoredInLabel"></span>
458- </h3>
459- <p class="uniqueItemStoredAlsoInContainer">
460- Also found in: <span class="uniqueItemStoredAlsoInLabel"></span>
461- </p>` ) ;
456+ <div>
457+ <h3>
458+ Stored in: <span class="uniqueItemStoredInLabel"></span>
459+ </h3>
460+ <p class="uniqueItemStoredAlsoInContainer">
461+ Also found in: <span class="uniqueItemStoredAlsoInLabel"></span>
462+ </p>
463+ </div>
464+ ` ) ;
465+ let alsoInLabel = storageLabel . find ( ".uniqueItemStoredAlsoInLabel" ) ;
462466
463467 itemData . storageBlocks . forEach ( function ( curBlock ) {
464468 promises . push ( Getters . StorageBlock . getStorageBlockLabel ( curBlock , function ( labelText ) {
@@ -467,7 +471,7 @@ export class ItemView extends PageUtility {
467471 if ( curBlock === stored . state . storageBlock ) {
468472 storageLabel . find ( ".uniqueItemStoredInLabel" ) . append ( newLink ) ;
469473 } else {
470- storageLabel . find ( ".uniqueItemStoredAlsoInLabel" ) . append ( newLink ) ;
474+ alsoInLabel . append ( newLink ) ;
471475 }
472476 } ) ) ;
473477 } ) ;
@@ -482,9 +486,8 @@ export class ItemView extends PageUtility {
482486 } )
483487 ) ;
484488 await Promise . all ( promises ) ;
485- if ( storageLabel . find ( ".uniqueItemStoredAlsoInLabel" ) . children ( ) . length === 0 ) {
486- // storageLabel.find(".uniqueItemStoredAlsoInContainer").remove();//for some reason this doesn't work ("find" doesn't work)
487- storageLabel . get ( 1 ) . remove ( )
489+ if ( alsoInLabel . children ( ) . length === 0 ) {
490+ storageLabel . find ( ".uniqueItemStoredAlsoInContainer" ) . hide ( ) ;
488491 }
489492 ItemView . storedSingleContainer . show ( ) ;
490493 } )
@@ -584,24 +587,6 @@ export class ItemView extends PageUtility {
584587
585588 console . log ( "Setting up view of stored." ) ;
586589
587- // let numStorageBlocks = itemData.stats.numStored;// Object.keys(itemData.storageBlocks).length;
588- //TODO:: show storage blocks associated
589- // if (numStorageBlocks === 0) {
590- // console.log("None stored.");
591- // ItemView.storedNonePresentContainer.show();
592- // //TODO:: if storage blocks present, prompt to edit item to add block(s)
593- // //TODO:: prompt to add stored item
594- // } else {
595- // //TODO:: display right; bulk vs multi vs single display
596- // console.log(numStorageBlocks + " stored.");
597- // ItemView.itemViewStoredNum.text(numStorageBlocks);
598- // ItemView.itemViewStored.show();
599- //
600- // ItemView.allStoredSearchFormItemInputName.val(itemData.name);
601- // ItemView.allStoredSearchFormItemInputId.val(itemId);
602- // ItemView.allStoredSearchForm.submit();
603- // }
604-
605590 ItemView . checkoutSearchFormItemNameInput . val ( itemData . name ) ;
606591 ItemView . checkoutSearchFormItemIdInput . val ( itemId ) ;
607592 ItemView . checkoutSearchForm . submit ( ) ;
0 commit comments