Add another (bad and stupid) way to update counters.

master
Artem Sapegin 2014-09-10 23:09:16 +04:00
parent 26165b9101
commit 1c8656c5df
1 changed files with 6 additions and 1 deletions

View File

@ -229,7 +229,12 @@ Triggers after popup window closed.
```javascript
$('.social-likes').on('popup_closed.social-likes', function(event, service) {
$(event.currentTarget).socialLikes({forceUpdate: true}); // Update counters
// Request new counters
$(event.currentTarget).socialLikes({forceUpdate: true});
// Or just increase the number
var counter = $(event.currentTarget).find('.social-likes__counter_' + service);
counter.text(+(counter.text()||0)+1).removeClass('social-likes__counter_empty');
});
```