ker/mod/tfw.view.combo.js
function copyContentOf() {
    const
        that = this,
        items = this.items,
        div = Dom.div( "thm-ele8" );
    items.forEach( function ( item, index ) {
        const clonedItem = Dom.div( that.index === index ? "thm-bgSL" : "thm-bg3" );
        if ( typeof item === 'string' ) {
            clonedItem.textContent = item;
        } else {
            clonedItem.innerHTML = Dom( item ).innerHTML;
        }
        Dom.add( div, clonedItem );
        const touchable = new Touchable( clonedItem );
        touchable.tap.add( () => {
            that.expanded = false;
            that.index = index;
        } );
    } );
    return div;
}
function copyContentOf() {
    const
        that = this,
        items = this.items,
        div = Dom.div( "thm-ele8" );
    items.forEach( function ( item, index ) {
        const clonedItem = Dom.div( that.index === index ? "thm-bgSL" : "thm-bg3" );
        if ( typeof item === 'string' ) {
            clonedItem.textContent = item;
        } else {
            clonedItem.innerHTML = Dom( item ).innerHTML;
        }
        Dom.add( div, clonedItem );
        const touchable = new Touchable( clonedItem );
        touchable.tap.add( () => {
            that.expanded = false;
            that.index = index;
        } );
    } );
    return div;
}
function copyContentOf ( ) { const that = this , items = this . items , div = Dom . div ( "thm-ele8" ) ; items . forEach ( function ( item , index ) { const clonedItem = Dom . div ( that . index === index ? "thm-bgSL" : "thm-bg3" ) ; if ( typeof item === 'string' ) { clonedItem . textContent = item ; } else { clonedItem . innerHTML = Dom ( item ) . innerHTML ; } Dom . add ( div , clonedItem ) ; const touchable = new Touchable ( clonedItem ) ; touchable . tap . add ( ( ) => { that . expanded = false ; that . index = index ; } ) ; } ) ; return div ; }
We sill copy the innerHTML of items and add a Touchable behaviour on each of them.
@this ViewXJS
@returns {DOMElement} DIV with all cloned items.
We sill copy the innerHTML of items and add a Touchable behaviour on each of them .