Spamworldpro Mini Shell
Spamworldpro


Server : Apache
System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64
User : corals ( 1002)
PHP Version : 7.4.33
Disable Function : exec,passthru,shell_exec,system
Directory :  /home/corals/cartforge.co/app/code/Amasty/MWishlist/view/frontend/web/js/action/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /home/corals/cartforge.co/app/code/Amasty/MWishlist/view/frontend/web/js/action/reload-blocks.js
define([
    'jquery'
], function ($) {
    'use strict';

    var selectorsMap = {
        'mwishlist.list.contrainer': [
            '[data-amwishlist-js="content-tabs-block"]',
            '[data-amwishlist-js="tabs-block"]'
        ],
        'customer.wishlist': [
            '[data-amwishlist-js="items-block"]',
            '[data-amwishlist-js="pager"]'
        ]
    };

    /**
     * Received selectors from block object
     *
     * @param {string} blockName
     * @return {array}
     */
    function getSelectors(blockName) {
        return selectorsMap[blockName];
    }

    /**
     * Reloading Html blocks which received from backend
     *
     * @param {object} blocks - custom keys which need to reload
     * @return {void}
     */
    return function (blocks) {
        $.each(blocks, function (blockName, blockContent) {
            var newBlockNode = $('<div>').append(blockContent);

            $.each(getSelectors(blockName), function (index, selector) {
                $(selector).html(newBlockNode.find(selector).html());
            });
        });

        $('body').trigger('contentUpdated');
    };
});

Spamworldpro Mini