Calculate real number of counters.

On HTTPS pages Google+ counter won’t work because Yandex Share API
doesn’t support HTTPS. In this case counter would never appear because
number of buttons is not the same as number of counters we could
request and show.
master
Artem Sapegin 2014-10-09 11:08:28 +04:00
parent 4fb091903e
commit e30e52f6e5
1 changed files with 5 additions and 4 deletions

View File

@ -231,17 +231,18 @@
this.initUserButtons();
this.countersLeft = 0;
this.number = 0;
this.container.on('counter.' + prefix, $.proxy(this.updateCounter, this));
var buttons = this.container.children();
this.countersLeft = buttons.length;
this.makeSingleButton();
this.buttons = [];
var buttons = this.container.children();
buttons.each($.proxy(function(idx, elem) {
this.buttons.push(new Button($(elem), this.options));
var button = new Button($(elem), this.options);
this.buttons.push(button);
if (button.options.counterUrl) this.countersLeft++;
}, this));
if (this.options.counters) {