Fix ready event.

master
Artem Sapegin 2014-01-16 15:06:36 +04:00
parent 86ec22e7f5
commit 5e06a01cac
1 changed files with 7 additions and 8 deletions

View File

@ -169,9 +169,7 @@ var counters = {
deferred.reject();
}
})
.fail(function() {
deferred.reject()
});
.fail(deferred.reject);
}
else {
deferred.reject();
@ -221,9 +219,12 @@ SocialLikes.prototype = {
this.number = 0;
this.container.on('counter.' + prefix, $.proxy(this.updateCounter, this));
this.countersLeft = 0;
this.container.children().each($.proxy(function(idx, elem) {
this.countersLeft++;
var buttons = this.container.children();
this.countersLeft = buttons.length;
this.makeSingleButton();
buttons.each($.proxy(function(idx, elem) {
new Button($(elem), this.options);
}, this));
@ -233,8 +234,6 @@ SocialLikes.prototype = {
else {
this.appear();
}
this.makeSingleButton();
},
initUserButtons: function() {
if (!this.userButtonInited && window.socialLikesButtons) {