Show counters after 10 sec even if they aren’t ready.
parent
4337bab741
commit
c2e2df35c6
|
@ -212,7 +212,8 @@
|
||||||
title: document.title,
|
title: document.title,
|
||||||
counters: true,
|
counters: true,
|
||||||
zeroes: false,
|
zeroes: false,
|
||||||
wait: 500,
|
wait: 500, // Show buttons only after counters are ready or after this amount of time
|
||||||
|
timeout: 10000, // Show counters after this amount of time even if they aren’t ready
|
||||||
popupCheckInterval: 500,
|
popupCheckInterval: 500,
|
||||||
singleTitle: 'Share'
|
singleTitle: 'Share'
|
||||||
};
|
};
|
||||||
|
@ -249,6 +250,7 @@
|
||||||
|
|
||||||
if (this.options.counters) {
|
if (this.options.counters) {
|
||||||
this.timer = setTimeout($.proxy(this.appear, this), this.options.wait);
|
this.timer = setTimeout($.proxy(this.appear, this), this.options.wait);
|
||||||
|
this.timeout = setTimeout($.proxy(this.ready, this, true), this.options.timeout);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
this.appear();
|
this.appear();
|
||||||
|
@ -330,13 +332,21 @@
|
||||||
this.countersLeft--;
|
this.countersLeft--;
|
||||||
if (this.countersLeft === 0) {
|
if (this.countersLeft === 0) {
|
||||||
this.appear();
|
this.appear();
|
||||||
this.container.addClass(prefix + '_ready');
|
this.ready();
|
||||||
this.container.trigger('ready.' + prefix, this.number);
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
appear: function() {
|
appear: function() {
|
||||||
this.container.addClass(prefix + '_visible');
|
this.container.addClass(prefix + '_visible');
|
||||||
},
|
},
|
||||||
|
ready: function(silent) {
|
||||||
|
if (this.timeout) {
|
||||||
|
clearTimeout(this.timeout);
|
||||||
|
}
|
||||||
|
this.container.addClass(prefix + '_ready');
|
||||||
|
if (!silent) {
|
||||||
|
this.container.trigger('ready.' + prefix, this.number);
|
||||||
|
}
|
||||||
|
},
|
||||||
getCounterElem: function() {
|
getCounterElem: function() {
|
||||||
var counterElem = this.widget.find('.' + classPrefix + 'counter_single');
|
var counterElem = this.widget.find('.' + classPrefix + 'counter_single');
|
||||||
if (!counterElem.length) {
|
if (!counterElem.length) {
|
||||||
|
|
Loading…
Reference in New Issue