From 98c39f5d561930fd4c73ccc182391dca69436ba5 Mon Sep 17 00:00:00 2001 From: Denis Shakhov Date: Wed, 30 Nov 2016 12:04:27 +0700 Subject: [PATCH] =?UTF-8?q?=D0=A8=D0=B0=D0=B1=D0=BB=D0=BE=D0=BD=20Synio?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Обновление блока с последней активностью после добавление комментария --- application/frontend/components/comment/js/comments.js | 2 ++ application/frontend/skin/synio/assets/js/init.js | 9 ++++++++- .../components/activity/blocks/block.activity-recent.tpl | 2 +- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/application/frontend/components/comment/js/comments.js b/application/frontend/components/comment/js/comments.js index 689eafb5..d95adb59 100644 --- a/application/frontend/components/comment/js/comments.js +++ b/application/frontend/components/comment/js/comments.js @@ -215,6 +215,8 @@ if ( $.isFunction( callback ) ) callback.call( this ); }); + + this._trigger('loaded'); }, /** diff --git a/application/frontend/skin/synio/assets/js/init.js b/application/frontend/skin/synio/assets/js/init.js index c5a0615b..a8324176 100644 --- a/application/frontend/skin/synio/assets/js/init.js +++ b/application/frontend/skin/synio/assets/js/init.js @@ -581,12 +581,19 @@ jQuery(document).ready(function($){ }); // Комментарии + var activityBlockRecent = $('.js-activity-block-recent'); + $('.js-topic-comments, .js-topic-comments-list').lsComments({ urls: { add: aRouter['blog'] + 'ajaxaddcomment/', load: aRouter['blog'] + 'ajaxresponsecomment/' }, - show_form: ls.registry.get('comment_show_form') + show_form: ls.registry.get('comment_show_form'), + loaded: function () { + if (activityBlockRecent.length) { + $('.js-activity-block-recent').lsBlock('getElement', 'tabs').lsTabs('getActiveTab').lsTab('activate'); + } + } }); // Кнопка обновления комментариев diff --git a/application/frontend/skin/synio/components/activity/blocks/block.activity-recent.tpl b/application/frontend/skin/synio/components/activity/blocks/block.activity-recent.tpl index a05a7b7e..cad6ce2c 100644 --- a/application/frontend/skin/synio/components/activity/blocks/block.activity-recent.tpl +++ b/application/frontend/skin/synio/components/activity/blocks/block.activity-recent.tpl @@ -12,7 +12,7 @@ {component 'block' mods = 'primary activity-recent' - classes = 'js-block-default' + classes = 'js-block-default js-activity-block-recent' title = {lang 'activity.block_recent.title'} titleUrl = {router 'stream'} footer = $smarty.capture.block_footer