瀏覽代碼

improved grid display without masonry

Bachir Soussi Chiadmi 6 年之前
父節點
當前提交
cab8fca868

文件差異過大導致無法顯示
+ 0 - 0
sites/all/themes/custom/edlptheme/assets/dist/scripts/main.min.js


+ 13 - 4
sites/all/themes/custom/edlptheme/assets/scripts/main.js

@@ -1537,13 +1537,20 @@
     function checkGridBlockHeight(){
       console.log('checkGridBlockHeight');
       var $r_h = _$row.height();
+      var $this;
       // console.log($r_h);
       $('.grid .col', _$row).each(function(i,e){
-        // console.log($(this).height(), $(this).innerHeight(), $(this).outerHeight());
-        if($(this).height() > $r_h){
-          $(this).height($r_h);
+        $this = $(this);
+        if(!$this.is('[init-height]')){
+          $this.attr('init-height', $this.outerHeight())
         }
-        // $(this).innerHeight(Math.min($(this).innerHeight(), _$row.height()));
+        // console.log($(this).height(), $(this).innerHeight(), $(this).outerHeight());
+        // if($this.height() > $r_h){
+        //   $this.height($r_h);
+        // }else{
+        //   $this.height('auto');
+        // }
+        $this.height(Math.min($this.attr('init-height'), _$row.height()));
       });
     };
 
@@ -1558,6 +1565,8 @@
           console.log(pos.top, $this.height(), pos.top+$this.height(), $r_h, $this);
           if(pos.top+$this.height() <= $r_h){
             $this.removeClass('offfield');
+          }else{
+            $this.addClass('offfield');
           }
         // });
       });

+ 1 - 0
sites/all/themes/custom/edlptheme/assets/styles/app.scss

@@ -1512,6 +1512,7 @@ body.path-frontpage, body.path-productions{
 
           }
           &.node--view-mode-text-1-column{
+            // box-sizing: border-box;
             padding:0 1em;
           }
         }

部分文件因文件數量過多而無法顯示