Sha256: 796a6762c75353efca41d4ff6ec2a993c0c164ea24c49b0c91068581b72e3bfc

Contents?: true

Size: 1011 Bytes

Versions: 2

Compression:

Stored size: 1011 Bytes

Contents

/**
 * @namespace WORKAREA.bundleOptionButtons
 */
WORKAREA.registerModule('bundleOptionButtons', (function () {
    'use strict';

    var replaceProductDetails = function (event) {
            var $link = $(event.delegateTarget),
                newUrl = $link.attr('href');

            event.preventDefault();

            $.get(newUrl, function (html) {
                var $newDetails = $(html)
                                    .find('.bundled-product-details')
                                        .addBack('.bundled-product-details');

                $link.closest('.bundled-product-details').replaceWith($newDetails);

                WORKAREA.initModules($newDetails);
            });
        },

        /**
         * @method
         * @name init
         * @memberof WORKAREA.bundleOptionButtons
         */
        init = function ($scope) {
            $('[data-bundle-option-button]', $scope).on('click', replaceProductDetails);
        };

    return {
        init: init
    };
}()));

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
workarea-product_bundles-1.0.1 app/assets/javascripts/workarea/storefront/product_bundles/modules/bundle_option_buttons.js
workarea-product_bundles-1.0.0 app/assets/javascripts/workarea/storefront/product_bundles/modules/bundle_option_buttons.js