Нет описания правки Метка: ручная отмена |
Нет описания правки Метка: отменено |
||
Строка 19: | Строка 19: | ||
// Подключаем Tippy.js через CDN динамически | // Подключаем Tippy.js через CDN динамически | ||
mw.loader.load('https://unpkg.com/@popperjs/core@2/dist/umd/popper.min.js').then(function() { | |||
mw.loader.load('https://unpkg.com/tippy.js@6/dist/tippy-bundle.umd.min.js').then(function() { | |||
// Подключаем CSS Tippy | |||
var tippyCSS = document.createElement('link'); | |||
tippyCSS.rel = 'stylesheet'; | |||
tippyCSS.href = 'https://unpkg.com/tippy.js@6/dist/tippy.css'; | |||
document.head.appendChild(tippyCSS); | |||
// Инициализация | // Инициализация | ||
$('.допуск-контейнер').each(function() { | |||
var content = $(this).find('.допуск-подсказка').html(); | |||
tippy(this, { | |||
content: content, | |||
allowHTML: true, | |||
interactive: true, | |||
placement: 'auto', | |||
maxWidth: '80vw', | |||
theme: 'dark', | |||
arrow: false, | |||
duration: [200, 200], | |||
popperOptions: { | |||
modifiers: [ | |||
{name: 'preventOverflow', options:{padding:8}}, | |||
{name: 'flip', options:{fallbackPlacements:['top','bottom','right','left']}} | |||
] | |||
} | |||
}); | |||
} | |||
}); | }); | ||
}); | }); | ||
} | }); | ||
}); | }); |
Версия от 12:54, 30 августа 2025
$(document).ready(function() {
// Инициализация боковой панели
$('.боковая-панель-кнопка').on('click', function() {
var targetId = $(this).data('target');
// Удаляем активный класс у всех кнопок
$('.боковая-панель-кнопка').removeClass('active');
// Добавляем активный класс текущей кнопке
$(this).addClass('active');
// Скрываем все разделы
$('.боковая-панель-раздел').removeClass('default');
// Показываем выбранный раздел
$('#' + targetId).addClass('default');
});
// Активируем первую кнопку по умолчанию
$('.боковая-панель-кнопка:first').click();
// Подключаем Tippy.js через CDN динамически
mw.loader.load('https://unpkg.com/@popperjs/core@2/dist/umd/popper.min.js').then(function() {
mw.loader.load('https://unpkg.com/tippy.js@6/dist/tippy-bundle.umd.min.js').then(function() {
// Подключаем CSS Tippy
var tippyCSS = document.createElement('link');
tippyCSS.rel = 'stylesheet';
tippyCSS.href = 'https://unpkg.com/tippy.js@6/dist/tippy.css';
document.head.appendChild(tippyCSS);
// Инициализация
$('.допуск-контейнер').each(function() {
var content = $(this).find('.допуск-подсказка').html();
tippy(this, {
content: content,
allowHTML: true,
interactive: true,
placement: 'auto',
maxWidth: '80vw',
theme: 'dark',
arrow: false,
duration: [200, 200],
popperOptions: {
modifiers: [
{name: 'preventOverflow', options:{padding:8}},
{name: 'flip', options:{fallbackPlacements:['top','bottom','right','left']}}
]
}
});
});
});
});
});