Vinoteca: модуль, шаблон и компоненты интернет-магазина вина на 1С-Битрикс

This commit is contained in:
jimagie committed 2026-10-22 19:28:52 +05:00
commit bb7d8af290
469 files changed
+26426

No files matched your search

@@ -0,0 +1,20 @@
(function () {
if (!window.BX || !BX.ajax || !BX.ajax.runAction) return;
var pending = null;
window.VinoState = {
first: function (name) {
if (!pending) {
pending = new Promise(function (resolve) {
BX.ajax.runAction('jinove:vinoteca.state.all', { method: 'GET' }).then(
function (response) { resolve((response && response.data) || {}); },
function () { resolve({}); }
);
});
}
return pending.then(function (all) {
if (!all[name]) throw new Error('state');
return { data: all[name] };
});
}
};
})();