refactor(orders): clean up order form structure and improve script loading

This commit is contained in:
2025-12-23 21:12:53 +03:00
parent b1d5ebb6df
commit d29c736252
2 changed files with 9 additions and 14 deletions

View File

@@ -325,14 +325,6 @@
return;
}
// Сохраняем текущее значение
const currentValue = $element.val();
const currentText = $element.find(':selected').text();
if (!currentValue) {
$element.empty();
}
// Инициализация Select2
$element.select2({
theme: 'bootstrap-5',
@@ -358,12 +350,8 @@
escapeMarkup: function(markup) { return markup; }
});
// Восстанавливаем значение
if (currentValue && currentText) {
$element.val(currentValue);
}
// Интеграция с DraftCreator при загрузке
const currentValue = $element.val();
if (currentValue && window.DraftCreator) {
setTimeout(function() {
window.DraftCreator.triggerDraftCreation();