1(function ($) {
2 window.OneClick = {
3 /**
4 *
5 * @param {Number} id - ID товара
6 * @param {String} name - название товара
7 */
8 order: function (id, name) {
9 var facadeName = window.localStorageFallback.getItem('selectedFacadeForItem' + id + '-short'),
10 colorName = window.localStorageFallback.getItem('selectedItemColorForItem' + id + '-short'),
11 itemSizes = itemSizesPrice = window.localStorageFallback.getItem('selectedItemSize' + id + '-price'),
12 itemSizesText = window.localStorageFallback.getItem('selectedItemSize' + id + '-text');
13 $.post('/oneclick/form', {
14 id: id,
15 url: window.location.href,
16 product_name: name,
17 color_corp: colorName,
18 color_facade: facadeName,
19 dim_text: itemSizes,
20 dimentions: itemSizesText
21 }, function (data) {
22 $('#modal-main .modal-content').html(data);
23 $('#modal-main').modal('show');
24 }.bind(this));
25 },
26
27 /**
28 * Отобразаит форму покупки в 1 клик.
29 *
30 * @param {Number|String} id
31 * @param {String} name
32 * @param {String} showWarning - yes|no
33 * @param {BasketInfo} basketInfo
34 * @param {String} warningText
35 */
36 showOneClickForm: function (id, showWarning, basketInfo, warningText) {
37 var warningText = warningText ? warningText : 'Без указания цвета доступен только заказ в 1 клик.';
38 $.post('/oneclick/form', {
39 id: id,
40 url: window.location.href,
...
</html>