Sha256: b7176902651822f72653cf9a02f8d36e2290b5c23becd57d6abe335a3a912850

Contents?: true

Size: 1.09 KB

Versions: 62

Compression:

Stored size: 1.09 KB

Contents

/**
 * @namespace WORKAREA.optionButtons
 */
WORKAREA.registerModule('optionButtons', (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('.product-details')
                                        .addBack('.product-details');

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

                if (_.isEmpty($newDetails.closest('.ui-dialog'))) {
                    window.history.replaceState(null, null, newUrl);
                }

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

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

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

Version data entries

62 entries across 62 versions & 1 rubygems

Version Path
workarea-storefront-3.4.27 app/assets/javascripts/workarea/storefront/modules/option_buttons.js
workarea-storefront-3.5.4 app/assets/javascripts/workarea/storefront/modules/option_buttons.js
workarea-storefront-3.4.26 app/assets/javascripts/workarea/storefront/modules/option_buttons.js
workarea-storefront-3.5.3 app/assets/javascripts/workarea/storefront/modules/option_buttons.js
workarea-storefront-3.4.25 app/assets/javascripts/workarea/storefront/modules/option_buttons.js
workarea-storefront-3.5.2 app/assets/javascripts/workarea/storefront/modules/option_buttons.js
workarea-storefront-3.4.24 app/assets/javascripts/workarea/storefront/modules/option_buttons.js
workarea-storefront-3.5.1 app/assets/javascripts/workarea/storefront/modules/option_buttons.js
workarea-storefront-3.4.23 app/assets/javascripts/workarea/storefront/modules/option_buttons.js
workarea-storefront-3.4.22 app/assets/javascripts/workarea/storefront/modules/option_buttons.js
workarea-storefront-3.5.0 app/assets/javascripts/workarea/storefront/modules/option_buttons.js
workarea-storefront-3.4.21 app/assets/javascripts/workarea/storefront/modules/option_buttons.js
workarea-storefront-3.5.0.beta.1 app/assets/javascripts/workarea/storefront/modules/option_buttons.js
workarea-storefront-3.4.20 app/assets/javascripts/workarea/storefront/modules/option_buttons.js
workarea-storefront-3.4.19 app/assets/javascripts/workarea/storefront/modules/option_buttons.js
workarea-storefront-3.4.18 app/assets/javascripts/workarea/storefront/modules/option_buttons.js
workarea-storefront-3.4.17 app/assets/javascripts/workarea/storefront/modules/option_buttons.js
workarea-storefront-3.4.16 app/assets/javascripts/workarea/storefront/modules/option_buttons.js
workarea-storefront-3.4.15 app/assets/javascripts/workarea/storefront/modules/option_buttons.js
workarea-storefront-3.4.14 app/assets/javascripts/workarea/storefront/modules/option_buttons.js