Ability to show zeroes.
parent
6412fcbb96
commit
b3ecbc8c55
|
@ -107,6 +107,12 @@ body {
|
|||
<li class="twitter" data-via="sapegin" data-related="DessiTeckel:Моя такса" data-url="http://github.com" data-title="Не #mail_ru" title="Опубликовать ссылку в Твиттере">Twitter</li>
|
||||
</ul>
|
||||
|
||||
<h3>Vertical (with zeroes)</h3>
|
||||
<ul class="social-likes social-likes_vertical" data-zeroes="yes">
|
||||
<li class="facebook" title="Опубликовать ссылку на Фейсбуке">Facebook</li>
|
||||
<li class="twitter" data-via="sapegin" data-related="DessiTeckel:Моя такса" data-url="http://github.com" data-title="Не #mail_ru" title="Опубликовать ссылку в Твиттере">Twitter</li>
|
||||
</ul>
|
||||
|
||||
<h3>Single button</h3>
|
||||
<ul class="social-likes social-likes_single" data-url="http://mail.ru/">
|
||||
<li class="facebook" title="Опубликовать ссылку на Фейсбуке">Facebook</li>
|
||||
|
|
|
@ -186,10 +186,15 @@ SocialLikes.prototype = {
|
|||
attr: 'html',
|
||||
defaultValue: function() { return '<a href="' + this.options.pageUrl + '">' + this.options.pageTitle + '</a>'; }
|
||||
},
|
||||
pageCounters: {
|
||||
showCounters: {
|
||||
attr: 'counters',
|
||||
defaultValue: 'yes',
|
||||
convert: function(value) { return value === 'yes'; }
|
||||
},
|
||||
showZeroes: {
|
||||
attr: 'zeroes',
|
||||
defaultValue: 'no',
|
||||
convert: function(value) { return value === 'yes'; }
|
||||
}
|
||||
},
|
||||
init: function() {
|
||||
|
@ -298,7 +303,7 @@ Button.prototype = {
|
|||
this.detectParams();
|
||||
this.initHtml();
|
||||
|
||||
if (this.options.pageCounters) {
|
||||
if (this.options.showCounters) {
|
||||
if (this.options.counterNumber) {
|
||||
this.updateCounter(this.options.counterNumber);
|
||||
}
|
||||
|
@ -392,7 +397,7 @@ Button.prototype = {
|
|||
|
||||
updateCounter: function(number) {
|
||||
number = parseInt(number, 10);
|
||||
if (!number) return;
|
||||
if (!number && !this.options.showZeroes) return;
|
||||
|
||||
var counterElem = $('<span>', {
|
||||
'class': this.getElementClassNames('counter'),
|
||||
|
|
Loading…
Reference in New Issue