فهرست منبع

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

AntonLV 5 سال پیش
والد
کامیت
54504ccecc
3فایلهای تغییر یافته به همراه19 افزوده شده و 2 حذف شده
  1. 8 0
      inc/js/classes/BxDolPage.js
  2. 4 0
      template/css/page_sticky.css
  3. 7 2
      template/scripts/BxBasePage.php

+ 8 - 0
inc/js/classes/BxDolPage.js

@@ -30,6 +30,14 @@ BxDolPage.prototype.stickyBlocks = function () {
         if ($(this).css('position') == 'sticky') {
             var iCh = $(this).height();
             var iWh = $(window).height();
+
+            if ($('#bx-toolbar').css('position') == 'fixed') {
+                $(this).css('top', $('#bx-content-main').offset().top + 'px');
+            }
+            else {
+                $(this).css('top', '60px');
+            }
+
             if (iCh > iWh) {
                 if (iCh - $(window).scrollTop() - $(window).height() < 0) {
                     var iMinS = (iWh - iCh);

+ 4 - 0
template/css/page_sticky.css

@@ -9,3 +9,7 @@
 	position:sticky; 
 	top:0
 }
+
+.bx-toolbar-up{
+	transform: none !important;
+}

+ 7 - 2
template/scripts/BxBasePage.php

@@ -19,6 +19,8 @@ class BxBasePage extends BxDolPage
 
     protected $_sStorage; //--- Storage object for page's images like custom cover, HTML block attachments, etc.
     protected $_oPageCacheObject = null;
+    
+    protected $_bStickyColumns = false;
 
     public function __construct ($aObject, $oTemplate)
     {
@@ -33,6 +35,8 @@ class BxBasePage extends BxDolPage
         
         $this->_sJsClassName = 'BxDolPage';
         $this->_sJsObjectName = 'oBxDolPage';
+        
+        $this->_bStickyColumns = isset($this->_aObject['sticky_columns']) && $this->_aObject['sticky_columns'] == 1;
     }
 
     /**
@@ -180,7 +184,7 @@ class BxBasePage extends BxDolPage
         $sJsObjClass = $this->getJsClassName();
         $sCode = "if(window['" . $sJsObjName . "'] == undefined) var " . $sJsObjName . " = new " . $sJsObjClass . "(" . json_encode(array(
             'sObjName' => $sJsObjName,
-            'isStickyColumns' => isset($this->_aObject['sticky_columns']) && $this->_aObject['sticky_columns'] == 1
+            'isStickyColumns' => $this->_bStickyColumns
         )) . ");";
 
         return $this->_wrapInTagJsCode($sCode);
@@ -477,7 +481,8 @@ class BxBasePage extends BxDolPage
     protected function _addJsCss()
     {
         $this->_oTemplate->addJs('BxDolPage.js');
-        $this->_oTemplate->addCss('page_sticky.css');
+		if ($this->_bStickyColumns)
+        	$this->_oTemplate->addCss('page_sticky.css');
         $this->_oTemplate->addCss('page_layouts.css');
     }