}
}
- var showid;
+ var showid = [];
if (mode === 'pickrandom') {
while (true) {
var ids = $(this).data('showid').split(',');
var idx = Math.floor(Math.random() * ids.length);
- showid = ids[idx];
+ showid = [ids[idx]];
if ($('div.link[data-hidden="1"][data-id$="' + showid + '"].show').length === 0 || ids.length === 0) {
break;
}
var ids = $(this).data('showid').split(',');
var current = $(this).data('current-showid');
if (current === undefined) {
- showid = ids[0];
+ showid = [ids[0]];
} else {
var idx = ids.indexOf(current) + 1;
if (idx === ids.length) {
idx = 0;
}
}
- showid = ids[idx];
+ showid = [ids[idx]];
}
- $(this).data('current-showid', showid);
+ $(this).data('current-showid', showid[0]);
} else {
- showid = $(this).data('showid');
+ showid = $(this).data('showid').split(',');
}
if (mode === 'exclusiveshow' || mode === 'shownext' || mode === 'shownextcycle' || mode === 'pickrandom') {
- $('div.link[data-hidden="1"].show:not([data-id$="' + showid + '"])').each(function () {
+ var selector = 'div.link[data-hidden="1"].show';
+ $.each(showid, function (k,id) {
+ selector += ':not([data-id$="' + id + '"])';
+ });
+ $(selector).each(function () {
$this.hidePlacedLink(this, (mode === 'shownext' || mode === 'shownextcycle') ? 500 : 0);
});
}
var close = $(this).data('showclose');
- $('div.link[data-id$="' + showid + '"]').each(function () {
- var l = this;
- if (close !== 'none') {
- $(l).append('<a href="#" class="linkshowclose ' + close + '"></a>');
- }
- $(l).show();
- $(l).trigger('fluidbook.link.show');
- if (close !== 'none') {
- $(l).removeClass('notinteractive');
- $(l).find('img').css('pointer-events', 'none');
- }
- setTimeout(function () {
- $(l).addClass('show');
- }, 10);
+ console.log(showid);
+ $.each(showid, function (k,id) {
+ $('div.link[data-id$="' + id + '"]').each(function () {
+ var l = this;
+ if (close !== 'none') {
+ $(l).append('<a href="#" class="linkshowclose ' + close + '"></a>');
+ }
+ $(l).show();
+ $(l).trigger('fluidbook.link.show');
+ if (close !== 'none') {
+ $(l).removeClass('notinteractive');
+ $(l).find('img').css('pointer-events', 'none');
+ }
+ setTimeout(function () {
+ $(l).addClass('show');
+ }, 10);
+ });
});
-
return false;
});