/** * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ /** * @deprecated since version 2.2.0 */ define([ 'jquery' ], function ($) { 'use strict'; /** * @param {*} args */ $.fn.terms = function (args) { // default var defaults = { start: 0, wrapper: '', showAnchor: '', effects: 'slide' }, options = $.extend(defaults, args); this.each(function () { var obj = $(this), wrapper = options.wrapper !== '' ? '> ' + options.wrapper : '', switches = $(wrapper + '> [data-section="title"] > [data-toggle="switch"]', obj), terms = $(wrapper + '> [data-section="content"]', obj), t = switches.length, marginTop = $(switches[0]).closest('[data-section="title"]').css('position') == 'absolute' ? 0 : null, //eslint-disable-line title, current, /** * @param {*} item */ showItem = function (item) { if (item != current && !$(switches[item]).closest('[data-section="title"]').hasClass('disabled')) { //eslint-disable-line $(switches).closest('[data-section="title"]').removeClass('active'); if (options.wrapper !== '') { $(switches).parent().parent().removeClass('active'); } $(terms).removeClass('active'); $(switches[item]).closest('[data-section="title"]').addClass('active'); if (options.wrapper !== '') { $(switches[current]).parent().parent().addClass('active'); } $(terms[item]).addClass('active'); current = item; } else if ( // Check if this is accordion width as criteria for now (obj.attr('data-sections') == 'accordion' || $(switches[item]).closest('[data-section="title"]').css('width') == obj.css('width')) && //eslint-disable-line item == current && !$(switches[item]).closest('[data-section="title"]').hasClass('disabled') //eslint-disable-line ) { $(switches).closest('[data-section="title"]').removeClass('active'); if (options.wrapper !== '') { $(switches).parent().parent().removeClass('active'); } $(terms).removeClass('active'); current = -1; } }, /** * Init. */ init = function () { var linksList, i, classes, dataSection, itemHref, itemClass, fromUrl; if (t > 0) { if ($(switches[0]).closest('[data-section="title"]').css('display') == 'table-cell') { //eslint-disable-line obj.addClass('adjusted'); if (obj[0].tagName == 'DL') { //eslint-disable-line eqeqeq, max-depth linksList = $('