Untitled

mail@pastecode.io avatar
unknown
plain_text
19 days ago
1.1 kB
1
Indexable
Never
ElementService.js
variableElements dodac Carousel
editableInSimplifiedModeElements dodac Carousel



WCarouselI    

/**
     * @inheritDoc
     */
    getVariableContentMap() {
        debugger;
        return {
            images: this.getImages().map((image) => image.serialize()),
        };
    }

    /**
     * @inheritDoc
     */
    setVariableContentMap(contentMap) {
        let imagesCopy = JSON.parse(JSON.stringify(contentMap.images));
        debugger;
        this._deserializeLinkInImages(imagesCopy);
        let images = imagesCopy.map((imageMap) => new CarouselImage({
            wCarousel: this,
            ...imageMap,
        }));
        this.setImages(images);
        this._recreateContent();
    }

    /**
     *
     * @param {Array<Object>} images
     * @private
     */
    _deserializeLinkInImages(images){
        if (webwave.utils.isArrayLike(images)){
            for (let i = 0, l = images.length; i < l; i++){
                images[i].wLink = LinkFactory.createLink(images[i].wLink);
            }
        }
    }


WCarouselContextBox.vue dodac do WObjectContextMenuBox ->         variable-content-box

Leave a Comment