roman.lesnikov@gmail.com 4 лет назад
Родитель
Сommit
f7feaff156

+ 0 - 1
modules/base/general/classes/BxBaseModGeneralFormEntry.php

@@ -474,7 +474,6 @@ class BxBaseModGeneralFormEntry extends BxTemplFormView
         $bMulticatEnabled = $this->_isMulticatEnabled();
         if ($bMulticatEnabled)
             $this->processMulticatBefore($CNF['FIELD_MULTICAT'], $aValsToAdd);
-
         $iContentId = parent::insert ($aValsToAdd, $isIgnore);
         
         if(!empty($iContentId)) {

+ 3 - 2
modules/boonex/artificer/data/template/bx_forum/css/main.css

@@ -1,5 +1,5 @@
 @import url(../../../../../forum/template/css/main.css);
-
+/*
 /*-- Participants --*/
 div.bx-forum-participants.left,
 div.bx-forum-participants.none,
@@ -51,6 +51,7 @@ div.bx-forum-participants.none .bx-forum-participant {
     white-space:normal;
     text-align: left !important;
 }
+/*
 .bx-base-unit-showcase-wrapper.bx-forum-wrapper:not(.flickity-enabled) .bx-base-text-unit-showcase{
     width: 100%
 }
@@ -99,4 +100,4 @@ div.bx-forum-participants.none .bx-forum-participant {
 .bx-base-unit-showcase-wrapper.bx-forum-wrapper{
     display: flex;
     flex-wrap: nowrap;
-}
+}*/

+ 13 - 0
modules/boonex/forum/classes/BxForumSearchResult.php

@@ -205,6 +205,19 @@ class BxForumSearchResult extends BxBaseModTextSearchResult
 
         return $aSql;
     }
+    
+    function displayResultBlock()
+    {
+        if ($this->bShowcaseView) {
+            $this->oModule->_oTemplate->addCss(array('unaca.css'));
+            $this->oModule->_oTemplate->addJs(array('unaca.js'));
+            
+            return $this->oModule->_oTemplate->parseHtmlByName('unaca.html', ['content' => str_replace(['bx-forum-wrapper', 'bx-base-unit-showcase-wrapper'], '' ,str_replace('bx-search-result-block', 'bx-search-result-block unaca-t', parent::displayResultBlock()))]);
+            
+        }
+
+        return parent::displayResultBlock();
+    }
 }
 
 /** @} */

+ 48 - 0
modules/boonex/forum/js/unaca.js

@@ -0,0 +1,48 @@
+function initUnaca(){
+     $(".unaca").each(function() {
+        var maxHeight = Math.max.apply(null, $(this).find(".unaca-t > div").map(function () {
+            return $(this).height();
+        }).get());
+        $(this).find(".unaca-t > div").height(maxHeight);
+    });
+}
+$( window ).resize(function() {
+    initUnaca();
+})    
+$(document).ready(function () {
+    initUnaca();
+    
+    $( ".unaca-c " ).click(function(evt) {
+        
+        var unaca = $(evt.target).parents('.unaca');
+        
+        var i = new Number(unaca.attr('data-slide')); 
+          
+        console.log(($(evt.target)));
+        
+        if ($(evt.target).hasClass('unaca-c-f'))
+            i =  i + 1;
+        else
+            i =  i - 1;
+        
+        unaca.find('.unaca-t').css('transform', 'translateX(-' + (i-1)*100 + '%)'); 
+        
+        setTimeout(function() { 
+            if (unaca.find('.unaca-t > div').last().offset().left < unaca.find('.unaca-t').parent().offset().left + unaca.find('.unaca-t').parent().width())
+                unaca.find('.unaca-c-f').hide();
+            else
+                unaca.find('.unaca-c-f').show();
+
+            if (unaca.find('.unaca-t > div').first().offset().left > 0 )
+
+                unaca.find('.unaca-c-b').hide();
+            else
+                unaca.find('.unaca-c-b').show();
+
+            unaca.find(".unaca-c-f" ).attr('for', 'unaca-a-'+ (i+1));
+            unaca.find(".unaca-c-b" ).attr('for', 'unaca-a-'+ (i-1))
+
+            unaca.find(".unaca-a-n" ).parents('.unaca').attr('data-slide', i);   
+        },400); 
+    }); 
+});

+ 123 - 0
modules/boonex/forum/template/css/unaca.css

@@ -0,0 +1,123 @@
+.unaca {
+  margin-left: auto;
+  margin-right: auto;
+  position: relative;
+}
+
+.unaca-a {
+  display: none;
+}
+
+.unaca-cc {
+    position: absolute;
+    width: 100%;
+    height: 100%;
+}
+.unaca-c-b{
+    position: absolute;
+    top: calc(50% - 30px);
+    left:-1rem;
+}
+.unaca-c-f{
+    position: absolute;
+    top: calc(50% - 30px);
+    right:-1rem;
+}
+
+.unaca-c {
+  background-color: #fff;
+  color: #3d414a;
+  border-radius: 100%;
+  box-shadow: 0 2px 10px 0 rgba(33, 34, 36, 0.3);
+  font-size: 24px;
+  height: 48px;
+  justify-content: center;
+  transition: 0.3s all;
+  width: 48px;
+  z-index: 1;
+}
+      
+.unaca-c label{
+    height: 48px;
+    width: 48px;
+    display: block;
+    z-index: 100;
+    position: absolute;
+    top:0px;
+    left:0px;
+     cursor: pointer;
+}
+.unaca-c svg{
+    position: absolute;
+    top:0px;
+    left:0px;
+}
+
+.unaca-s {
+  overflow: hidden;
+    width: 100%;
+}
+
+.unaca-t {
+  font-size: 0;
+  transition: all 0.3s ease 0s;
+  white-space: nowrap;
+  -webkit-overflow-scrolling: touch;
+    overflow: visible !important;
+}
+
+.unaca-t > div {
+  display: inline-flex !important;
+  vertical-align: top !important;
+  white-space: normal !important;
+    width: 25% !important;
+}
+
+.unaca-i--desktop-in-1 {
+  width: 100%;
+}
+
+.unaca-i--desktop-in-2 {
+  width: 50%;
+}
+
+.unaca-i {
+  width: 33.3333333333%;
+}
+
+.unaca-t .bx-base-text-unit-showcase {
+    margin: 0;
+    padding: 0.25rem;
+}
+
+.bx-media-phone .unaca-cc {
+    display: none;
+}
+.bx-media-phone .unaca-s {
+    margin-left: 0;
+    margin-right: 0;
+}
+.bx-media-phone .unaca-t {
+    overflow-x: auto !important;
+    width: auto;
+}
+.bx-media-phone .unaca-t > div {
+    width: 100% !important;
+}
+
+
+
+.bx-media-tablet .unaca-cc {
+    display: none;
+}
+.bx-media-tablet .unaca-s {
+    margin-left: 0;
+    margin-right: 0;
+}
+.bx-media-tablet .unaca-t {
+    overflow-x: auto !important;
+    width: auto;
+}
+.bx-media-tablet .unaca-t > div {
+    width: 50% !important;
+}

+ 27 - 0
modules/boonex/forum/template/unaca.html

@@ -0,0 +1,27 @@
+<div class='unaca' data-slide='1'>
+    <input checked='checked' class='unaca-a unaca-a-p' id='unaca-a-1' name='unaca1' type='radio'>
+    <input  class='unaca-a unaca-a-m' id='unaca-a-2' name='unaca1' type='radio'>
+    <input  class='unaca-a unaca-a-n' id='unaca-a-3' name='unaca1' type='radio'>
+    <input  class='unaca-a unaca-a-n' id='unaca-a-4' name='unaca1' type='radio'>
+    <input  class='unaca-a unaca-a-n' id='unaca-a-5' name='unaca1' type='radio'>
+    <input  class='unaca-a unaca-a-n' id='unaca-a-6' name='unaca1' type='radio'>
+    <input  class='unaca-a unaca-a-n' id='unaca-a-7' name='unaca1' type='radio'>
+    <input  class='unaca-a unaca-a-n' id='unaca-a-8' name='unaca1' type='radio'>
+    <input  class='unaca-a unaca-a-n' id='unaca-a-9' name='unaca1' type='radio'>
+    <input  class='unaca-a unaca-a-n' id='unaca-a-10' name='unaca1' type='radio'>
+    <div class='unaca-cc'>
+        <div class='unaca-c unaca-c-b'>
+            <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='currentColor'>
+                <path fill-rule='evenodd' d='M12.707 5.293a1 1 0 010 1.414L9.414 10l3.293 3.293a1 1 0 01-1.414 1.414l-4-4a1 1 0 010-1.414l4-4a1 1 0 011.414 0z' clip-rule='evenodd' />
+            </svg>
+            <label class='unaca-c-b' for='unaca-a-1' style='display: none;'></label>
+        </div>
+        <div class='unaca-c unaca-c-f'>
+            <svg xmlns='http://www.w3.org/2000/svg'  viewBox='0 0 20 20' fill='currentColor'>
+                <path fill-rule='evenodd' d='M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z' clip-rule='evenodd' />
+            </svg>
+            <label for='unaca-a-2' class='unaca-c-f'></label>
+        </div>          
+    </div>
+    <div class='unaca-s'>__content__</div>
+</div>