Vinoteca: wine shop on 1C-Bitrix (module, template, components, pages)

This commit is contained in:
jimagie committed 2026-10-22 23:22:27 +05:00
commit 52795535ae
586 files changed
+27619

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] };
});
}
};
})();