File tree Expand file tree Collapse file tree 2 files changed +25
-18
lines changed
packages/web-component/src
components/read-along-component Expand file tree Collapse file tree 2 files changed +25
-18
lines changed Original file line number Diff line number Diff line change @@ -1539,14 +1539,20 @@ export class ReadAlongComponent {
15391539 *
15401540 * @param props
15411541 */
1542- Img = ( props : { imgURL : string } ) : Element => {
1542+ Img = ( props : { imgURL : string ; pageIndex : number } ) : Element => {
15431543 return (
15441544 < div
15451545 class = {
15461546 "image__container page__col__image theme--" +
15471547 this . userPreferences . theme
15481548 }
15491549 >
1550+ { this . mode === "EDIT" && (
1551+ < span id = "image-container" >
1552+ < this . RemoveImg pageIndex = { props . pageIndex } />
1553+ </ span >
1554+ ) }
1555+
15501556 < img alt = { "image" } class = "image" src = { props . imgURL } />
15511557 </ div >
15521558 ) ;
@@ -1609,22 +1615,23 @@ export class ReadAlongComponent {
16091615 const hasImage =
16101616 props . pageIndex in this . images && this . images [ props . pageIndex ] !== null ;
16111617
1612- return (
1613- < div class = "image__container" >
1614- < span id = "image-container" >
1615- { this . mode === "EDIT" && hasImage && (
1616- < this . RemoveImg pageIndex = { props . pageIndex } />
1617- ) }
1618- { hasImage && < this . Img imgURL = { this . images [ props . pageIndex ] } /> }
1619- </ span >
1620- { this . mode === "EDIT" && ! hasImage && (
1621- < this . ImgPlaceHolder
1622- pageID = { props . pageID }
1623- pageIndex = { props . pageIndex }
1624- />
1625- ) }
1626- </ div >
1627- ) ;
1618+ if ( hasImage ) {
1619+ return (
1620+ < this . Img
1621+ imgURL = { this . images [ props . pageIndex ] }
1622+ pageIndex = { props . pageIndex }
1623+ />
1624+ ) ;
1625+ }
1626+
1627+ if ( this . mode === "EDIT" ) {
1628+ return (
1629+ < this . ImgPlaceHolder
1630+ pageID = { props . pageID }
1631+ pageIndex = { props . pageIndex }
1632+ />
1633+ ) ;
1634+ }
16281635 } ;
16291636
16301637 /**
Original file line number Diff line number Diff line change 5858}
5959
6060#img-remover {
61- margin : 60 px ;
61+ margin : 0 ;
6262 position : absolute ;
6363 z-index : functions .z (" nav" );
6464 border-radius : 50px ;
You can’t perform that action at this time.
0 commit comments