Просмотр исходного кода

Merge branch 'master' of https://github.com/unaio/una

RomanL 7 лет назад
Родитель
Сommit
9283b47447

+ 12 - 3
modules/boonex/shopify/js/shop.js

@@ -62,9 +62,13 @@ BxShopifyShop.prototype.onGetUnit = function(oProduct) {
     oUnit.find('.bx-spf-unit-title').html(oProduct.title);
 
     //--- Fetch product description.
-    oUnit.find('.bx-spf-unit-summary').html(oProduct.description);
+    oUnit.find('.bx-spf-unit-summary').html(oProduct.descriptionHtml);
     oUnit.find('.bx-base-text-unit-strecher').html(oProduct.description);
 
+    //--- Fetch product images.
+    if(oProduct.images.length > 0)
+        oUnit.find('.bx-spf-unit-thumb').css('background-image', 'url(' + oProduct.images[0].src + ')');
+
     //--- Fetch price.
     if(oProduct.variants.length > 0) {
         var oBuy = oUnit.find('.bx-shopify-buy');
@@ -73,6 +77,11 @@ BxShopifyShop.prototype.onGetUnit = function(oProduct) {
     }
 
     bx_loading(oUnit.removeClass(this._sClassLoading).addClass(this._sClassLoaded), false);
+
+    //--- Update Showcase wrapper.
+    var oWrapper = oUnit.parents('.bx-base-unit-showcase-wrapper:first');
+    if(oWrapper.length > 0 && oWrapper.hasClass('flickity-enabled'))
+        oWrapper.flickity('resize');
 };
 
 BxShopifyShop.prototype.getEntry = function(sProduct) {
@@ -98,7 +107,7 @@ BxShopifyShop.prototype.onGetEntry = function(oProduct) {
     $('#' + this._aHtmlIds['entry_content']).find('.bx-spf-title').html(oProduct.title);
 
     //--- Fetch product description.
-    $('#' + this._aHtmlIds['entry_content']).find('.bx-spf-text').html(oProduct.description);
+    $('#' + this._aHtmlIds['entry_content']).find('.bx-spf-text').html(oProduct.descriptionHtml);
 
     //--- Fetch product images.
     var oSample = $('#' + this._aHtmlIds['entry_attachment_sample']);
@@ -117,7 +126,7 @@ BxShopifyShop.prototype.onGetEntry = function(oProduct) {
         oPopup.attr('id', sPopupId.replace('{id}', iImage));
         oPopup.find('.bx-spf-attachment-popup-img').attr('src', oImage.src);
 
-        oContainer.prepend(oAttachment);
+        oContainer.append(oAttachment);
 
         iImage += 1;
     });

+ 5 - 1
modules/boonex/shopify/template/css/unit.css

@@ -1,5 +1,9 @@
+.bx-spf-unit-actions {
+    text-align: center;
+}
+
 .bx-spf-unit-actions .bx-btn {
-	display: inline-block;
+    display: inline-block;
     float: none;
     vertical-align: top;
 }

+ 1 - 1
modules/boonex/shopify/template/unit_showcase.html

@@ -1 +1 @@
-<bx_include_base:../modules/base/text/template/unit_showcase.html />
+<bx_include_auto:unit_gallery.html />