From 19f6bb039ee3ca42e364e6184834156fda654216 Mon Sep 17 00:00:00 2001 From: Chiffa Date: Wed, 30 Dec 2015 23:58:07 +0500 Subject: [PATCH] Fix user follow MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Текстовки менялись не у того элемента --- .../frontend/components/user/js/user-follow.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/application/frontend/components/user/js/user-follow.js b/application/frontend/components/user/js/user-follow.js index 7cd3556c..ee9b6d83 100644 --- a/application/frontend/components/user/js/user-follow.js +++ b/application/frontend/components/user/js/user-follow.js @@ -24,6 +24,9 @@ // Отписаться unfollow: null }, + selectors: { + item: '> a' + }, classes: { active: 'active' }, @@ -60,7 +63,8 @@ * Коллбэк вызываемый при подписке */ onFollow: function( response ) { - this._addClass( 'active' ).text( ls.lang.get('user.actions.unfollow') ); + this.elements.item.text( ls.lang.get('user.actions.unfollow') ); + this._addClass( 'active' ); }, /** @@ -74,7 +78,8 @@ * Коллбэк вызываемый при отписке */ onUnfollow: function( response ) { - this._removeClass( 'active' ).text( ls.lang.get('user.actions.follow') ); + this.elements.item.text( ls.lang.get('user.actions.follow') ); + this._removeClass( 'active' ); } }); -})(jQuery); \ No newline at end of file +})(jQuery);