RomanL 5 лет назад
Родитель
Сommit
0242010761

+ 4 - 48
inc/js/classes/BxDolPage.js

@@ -5,8 +5,7 @@
  * @defgroup    UnaCore UNA Core
  * @{
  */
-function BxDolPage(oOptions)
-{
+function BxDolPage(oOptions) {
     this._sObjName = oOptions.sObjName == undefined ? 'oBxDolPage' : oOptions.sObjName;
     this._isStickyColumns = oOptions.isStickyColumns == undefined ? false : oOptions.isStickyColumns;
     this._iLastSc = 0;
@@ -19,53 +18,10 @@ function BxDolPage(oOptions)
 BxDolPage.prototype.init = function () {
     var $this = this;
     if ($this._isStickyColumns && !$('html').hasClass('bx-media-phone')) {
-        $(window).resize(function () { $this.stickyBlocks() });
-        $(window).scroll(function () { $this.stickyBlocks() });
+        $('.bx-layout-col').theiaStickySidebar({
+            additionalMarginTop: 30
+        });
     }
 };
 
-BxDolPage.prototype.stickyBlocks = function () {
-    iSc = $(window).scrollTop();
-    $.each($('.bx-layout-col'), function (index, val) {
-        if ($(this).css('position') == 'sticky') {
-            var iCh = $(this).height();
-            var iWh = $(window).height();
-
-            if ($('#bx-toolbar').css('position') == 'fixed') {
-                console.log($('#bx-content-main').offset().top - $('.bx-menu-toolbar-padding').height());
-                $(this).css('top', $('#bx-toolbar').height()+ 'px');
-            }
-            else {
-                $(this).css('top', '60px');
-            }
-
-            if (iCh > iWh) {
-                if (iCh - $(window).scrollTop() - $(window).height() < 0) {
-                    var iMinS = (iWh - iCh);
-                    if ($(this).css('top') == '') {
-                        $(this).css('top', iMinS + 'px');
-                    }
-                    else {
-                        var iCurS = new Number($(this).css('top').replace('px', '')) - iSc + this._iLastSc;
-                        if (iCurS > 0) {
-                            console.log(2);
-                            $(this).css('top', '0px');
-                        }
-                        if (iCurS < iMinS) {
-                            console.log(3);
-                            $(this).css('top', iMinS + 'px');
-                        }
-                        if (iCurS < 0 && iCurS > iMinS) {
-                            console.log(4);
-                            $(this).css('top', iCurS + 'px');
-                        }
-                    }
-                }
-            }
-        }
-    });
-    this._iLastSc = iSc <= 0 ? 0 : iSc;
-}
-
-
 /** @} */

+ 21 - 0
plugins_public/theia-sticky-sidebar/LICENSE.txt

@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) 2014 Liviu Cristian Mirea Ghiban
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.

Разница между файлами не показана из-за своего большого размера
+ 0 - 0
plugins_public/theia-sticky-sidebar/ResizeSensor.min.js


Разница между файлами не показана из-за своего большого размера
+ 0 - 0
plugins_public/theia-sticky-sidebar/theia-sticky-sidebar.min.js


+ 1 - 3
template/scripts/BxBasePage.php

@@ -480,9 +480,7 @@ class BxBasePage extends BxDolPage
      */
     protected function _addJsCss()
     {
-        $this->_oTemplate->addJs('BxDolPage.js');
-		if ($this->_bStickyColumns)
-        	$this->_oTemplate->addCss('page_sticky.css');
+        $this->_oTemplate->addJs(array('BxDolPage.js', 'theia-sticky-sidebar/ResizeSensor.min.js', 'theia-sticky-sidebar/theia-sticky-sidebar.min.js'));
         $this->_oTemplate->addCss('page_layouts.css');
     }
 

Некоторые файлы не были показаны из-за большого количества измененных файлов