Просмотр исходного кода

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

AntonLV 2 лет назад
Родитель
Сommit
d045a54d9c

+ 24 - 1
modules/boonex/timeline/js/main.js

@@ -561,4 +561,27 @@ BxTimelineMain.prototype._getPost = function(oView, iId, aParams) {
         },
         'json'
     );
-};
+};
+
+/**
+ * Allows to attache callback functions on Get Post event
+ * @param oView
+ * @param iId
+ * @param aParams
+ */
+BxTimelineMain.prototype.onGetPost = function(oView, iId, aParams) {
+    const mixedCallback = this.aGetPostCallbacks;
+
+    if (!mixedCallback)
+        return;
+
+    if (typeof mixedCallback === 'function')
+        mixedCallback(oView, iId, aParams);
+
+    if (Array.isArray(mixedCallback)){
+        for (let i in mixedCallback) {
+            if (typeof mixedCallback[i] === 'function')
+                mixedCallback[i](oView, iId, aParams);
+        }
+    }
+}

+ 3 - 0
modules/boonex/timeline/js/post.js

@@ -97,6 +97,9 @@ BxTimelinePost.prototype.afterFormPostSubmit = function (oForm, oData)
             $('.' + $this.sClassView + ':visible').each(function() {
                 var oView = $(this);
                 $this._getPost(oView, iId, jQuery.extend({}, $this._oRequestParams, {view: $this._getView(oView), afps_loading: 1}));
+
+                // Attach callback on get post */
+                $this.onGetPost(oView, iId, jQuery.extend({}, $this._oRequestParams, {view: $this._getView(oView), afps_loading: 1}));
             });
         }
 

+ 2 - 0
template/scripts/BxBasePrivacy.php

@@ -138,6 +138,7 @@ class BxBasePrivacy extends BxDolPrivacy
         }
 
         $iGroupId = $oForm->getGroupId();
+        $oForm->setId( $oForm->getId() . '_' . $iGroupId );
         $sContent = BxTemplFunctions::getInstance()->transBox($this->_aHtmlIds['group_custom_select_popup'] . $iGroupId, $this->_oTemplate->parseHtmlByName('privacy_group_custom_select_popup.html', array(
             'js_object' => $sJsObject,
             'group' => $iGroupId,
@@ -195,6 +196,7 @@ class BxBasePrivacy extends BxDolPrivacy
         }
 
         $iGroupId = $oForm->getGroupId();
+        $oForm->setId($oForm->getId() . '_' . $iGroupId);
         $sContent = BxTemplFunctions::getInstance()->transBox($this->_aHtmlIds['group_custom_select_popup'] . $iGroupId, $this->_oTemplate->parseHtmlByName('privacy_group_custom_select_popup.html', array(
             'js_object' => $sJsObject,
             'group' => $iGroupId,