PageSourceSearch

https://www.bbbsportinggoods.com/js/addons/abt__unitheme2/abt__ut2_column_calculator.js?ver=1790171188

js bbbsportinggoods.com collected 2026-09-24 14:11:32 UTC 5,371 bytes, 93 lines download raw bytes

1/*******************************************************************************************
2*   ___  _          ______                     _ _                _                        *
3*  / _ \| |         | ___ \                   | (_)              | |              © 2026   *
4* / /_\ | | _____  _| |_/ /_ __ __ _ _ __   __| |_ _ __   __ _   | |_ ___  __ _ _ __ ___   *
5* |  _  | |/ _ \ \/ / ___ \ '__/ _` | '_ \ / _` | | '_ \ / _` |  | __/ _ \/ _` | '_ ` _ \  *
6* | | | | |  __/>  <| |_/ / | | (_| | | | | (_| | | | | | (_| |  | ||  __/ (_| | | | | | | *
7* \_| |_/_|\___/_/\_\____/|_|  \__,_|_| |_|\__,_|_|_| |_|\__, |  \___\___|\__,_|_| |_| |_| *
8*                                                         __/ |                            *
9*                                                        |___/                             *
10* ---------------------------------------------------------------------------------------- *
11* This is commercial software, only users who have purchased a valid license and accept    *
12* to the terms of the License Agreement can install and use this program.                  *
13* ---------------------------------------------------------------------------------------- *
14* website: https://cs-cart.alexbranding.com                                                *
15*   email: [email protected]                                                           *
16*******************************************************************************************/
17(function(_, $) {
18let prev_doc_width = 0;
19const fn_debounced__catalogSubmenuNotCascading2ndListColumnFilling = utility__debounceUnderscore(fn__catalogSubmenuNotCascading2ndListColumnFilling, 200);
20function fn__catalogSubmenuNotCascading2ndListColumnFilling(flag__force) {
21const one_col_width = parseInt(getComputedStyle(document.documentElement).getPropertyValue('--menu-col-min-width'));
22let new_doc_width = $(document).width();
23if ((new_doc_width === prev_doc_width && flag__force !== true) || window.matchMedia('(max-width: 767px)').matches) {
24return true;
25}
26prev_doc_width = new_doc_width;
27$('.ut2-menu').each(function () {
28const $menu = $(this);
29if ($menu.closest(".menu-vendor-categories").length > 0) return;
30const $menu_inbox = $menu.children('.ut2-menu__inbox');
31const $menu_list = $menu.find('.ut2-menu__list')
32const setting_cols = parseInt(getComputedStyle($menu_list.get(0)).getPropertyValue('--menu-columns'));
33const flag__is_compact = $menu_list.closest('.compact').length >= 1 && $menu.closest('.menu-1level').length < 1;
34const flag__is_vertical = $menu.is('.ut2-v__menu');
35const top_level_column_width = flag__is_vertical ? parseInt(getComputedStyle(document.documentElement).getPropertyValue('--menu-main-width')) + 1 : 0;
36$menu_list.find('.ut2-menu__item').not('.item-1st-no-drop').each(function () {
37const item_1st_lvl = $(this);
38const $submenu_carrier = item_1st_lvl.find('.ut2-menu__submenu__carrier').not('.cascading').not('.row-filling');
39if ($submenu_carrier.length) {
40const subitems_count = item_1st_lvl.data('subitemsCount');
41const $submenu_list_wrapper = $submenu_carrier.children('.ut2-menu__submenu__wrapper');
42const $submenu_list = $submenu_list_wrapper.children('.ut2-menu__2nd-list');
43const submenu_list_gap = parseInt(getComputedStyle($submenu_list.get(0)).getPropertyValue('gap'));
44const $submenu_cols = $submenu_list.children('.ut2-menu__2nd-col');
45let submenu_list_width;
46let drodown_width;
47let fitting_cols;
48$submenu_list.data('fitting_cols', 0);
49if ((!flag__is_vertical && $submenu_list.is(':visible')) || (flag__is_vertical && $submenu_list.is(':visible') && $menu_inbox.length && $menu_inbox.width() > top_level_column_width)) {
50submenu_list_width = $submenu_list.width();
51} else {
52if (flag__is_compact && window.matchMedia('(min-width: 1024px)').matches) {
53drodown_width = top_level_column_width * 3;
54} else if (!flag__is_compact || (flag__is_compact && window.matchMedia('(max-width: 1023px)').matches)) {
55drodown_width = $submenu_list.closest('.container-fluid-row').children('.row-fluid').width();
56}
57submenu_list_width =
58drodown_width - top_level_column_width -
59parseInt(getComputedStyle($submenu_carrier.get(0)).getPropertyValue('padding-inline-end')) -
60parseInt(getComputedStyle($submenu_list_wrapper.get(0)).getPropertyValue('padding-inline-end')) -
61parseInt(getComputedStyle($submenu_list_wrapper.get(0)).getPropertyValue('padding-inline-start'));
62}
63
64fitting_cols = Math.floor((submenu_list_width + submenu_list_gap) / (one_col_width + submenu_list_gap));
65if (setting_cols >= fitting_cols) {
66if ($submenu_list.data('fitting_cols') !== fitting_cols) {
67$submenu_list.data('fitting_cols', fitting_cols);
68if ($submenu_cols.length >= fitting_cols) {
69let items_in_cols = Math.ceil(subitems_count / fitting_cols);
70let big_cols_count = subitems_count % fitting_cols;
71let index = 0;
72for (let i = 0; i < fitting_cols; i++) {
73if (i === big_cols_count && big_cols_count !== 0) {
74items_in_cols--;
75}
76let $column = $submenu_cols.eq(i);
77for (let j = 0; j < items_in_cols; j++) {
78let $li = $submenu_list.find('[data-elem-index=' + index++ + ']');
79$li.appendTo($column);
80}
81}
82}
83}
84}
85}
86});
87});
88}
89$.ceEvent('on', 'ce.ut2-hm-toggle', function(btn, parent, elem, is_prev){
90fn__catalogSubmenuNotCascading2ndListColumnFilling(true);
91});
92$(window).on('resize.menu_column_filling', fn_debounced__catalogSubmenuNotCascading2ndListColumnFilling);
93}(Tygh, Tygh.$));

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.