AntonLV 5 年 前
親
コミット
75976c35a0

+ 0 - 1
modules/boonex/timeline/classes/BxTimelineModule.php

@@ -309,7 +309,6 @@ class BxTimelineModule extends BxBaseModNotificationsModule implements iBxDolCon
     function actionGetView()
     {
         $aParams = $this->_prepareParamsGet();
-        $aParams['js_init_view'] = false;
 
         $sConten = $this->_oTemplate->getViewBlock($aParams);
         if(empty($sConten))

+ 1 - 9
modules/boonex/timeline/classes/BxTimelineTemplate.php

@@ -115,7 +115,6 @@ class BxTimelineTemplate extends BxBaseModNotificationsTemplate
     public function getJsCodeView($aParams = array(), $bWrap = true, $bDynamic = false)
     {
         $aParams = array_merge(array(
-            'bInit' => true,
             'bInfScroll' => $this->_oConfig->isInfiniteScroll(),
             'iInfScrollAutoPreloads' => $this->_oConfig->getAutoPreloads(),
         ), $aParams);
@@ -188,12 +187,6 @@ class BxTimelineTemplate extends BxBaseModNotificationsTemplate
     {
         $oModule = $this->getModule();
 
-        $bJsInitView = true;
-        if(isset($aParams['js_init_view'])) {
-            $bJsInitView = (bool)$aParams['js_init_view'];
-            unset($aParams['js_init_view']);
-        }
-
         list($sContent, $sLoadMore, $sBack, $sEmpty, $iEvent, $bEventsToLoad) = $this->getPosts($aParams);
 
         //--- Add live update
@@ -233,8 +226,7 @@ class BxTimelineTemplate extends BxBaseModNotificationsTemplate
                 'sObjName' => $sJsObject,
                 'sVideosAutoplay' => $this->_oConfig->getVideosAutoplay(),
                 'bEventsToLoad' => $bEventsToLoad,
-            	'oRequestParams' => $aParams,
-                'bInit' => $bJsInitView
+            	'oRequestParams' => $aParams
             ), array(
                 'wrap' => true,
                 'mask_markers' => array('object' => $sJsObject)

+ 6 - 10
modules/boonex/timeline/js/view.js

@@ -23,7 +23,6 @@ function BxTimelineView(oOptions) {
     this._aHtmlIds = oOptions.aHtmlIds == undefined ? {} : oOptions.aHtmlIds;
     this._oRequestParams = oOptions.oRequestParams == undefined ? {} : oOptions.oRequestParams;
 
-    this._bInit = oOptions.bInit == undefined ? true : oOptions.bInit;
     this._bInfScroll = oOptions.bInfScroll == undefined ? false : oOptions.bInfScroll;
     this._iInfScrollAutoPreloads = oOptions.iInfScrollAutoPreloads == undefined ? 10 : oOptions.iInfScrollAutoPreloads;
     this._sInfScrollAfter = 'item';
@@ -43,14 +42,11 @@ function BxTimelineView(oOptions) {
     if(typeof window.glBxTimelineVapPlayers === 'undefined')
         window.glBxTimelineVapPlayers = [];
 
+    //--- Get currently active 'view'.
     this.initView();
 
-    if(this._bInit) {
-        var $this = this;
-        $(document).ready(function() {
-            $this.init();
-        });
-    }
+    //--- Initialize components on currently active 'view'.
+    this.init();
 }
 
 BxTimelineView.prototype = Object.create(BxTimelineMain.prototype);
@@ -409,6 +405,8 @@ BxTimelineView.prototype.changeView = function(oLink, sType, oRequestParams)
         oViewBefore.hide();
         oViews.find(sView).show();
 
+        this.initView();
+
         return;
     }
 
@@ -432,9 +430,7 @@ BxTimelineView.prototype.changeView = function(oLink, sType, oRequestParams)
             oContent.filter(sView).hide();
 
             oViewBefore.hide();
-            oViews.append(oContent).find(sView).bxProcessHtml().show(function() {
-                $this.init(true);
-            });
+            oViews.append(oContent).find(sView).bxProcessHtml().show();
         },
         'json'
     );