index += '</div>';
index += '<div class="fonctions">';
if (this.fluidbook.datas.friend) {
- index += '<a class="send miniOnPortrait" href="#"><span class="hideOnPortrait">' + this.fluidbook.l10n.__('send') + '</span></a>';
+ index += '<a class="send" href="#">' + this.fluidbook.l10n.__('send') + '</a>';
}
if (this.fluidbook.datas.print || this.fluidbook.datas.pdf) {
- index += '<a class="print miniOnPortrait" href="#"><span class="hideOnPortrait">' + this.fluidbook.l10n.__('download') + '</span></a>';
+ index += '<a class="print" href="#">' + this.fluidbook.l10n.__('download') + '</a>';
}
index += '</div>';
index += '</div>';
});
$(document).on('click touchend', '#zoomPopupOverlay, #zoomPopupWrapper', function (e) {
- console.log('closing zoomPopup...');
+
$this.zoomLinkReset();
});
$link = $(link),
box = $link[0].getBoundingClientRect(),
parent = $link.closest('.link'),
- linkId = $(parent).attr('id').split('_', 2)[1],
maxZoom = parseInt($link.data('maxzoom')) || 2,
- zoomImage = 'data/links/zoom_' + linkId + '.jpg',
x,
y,
zoomWidth,
zoomHeight,
zoomScale;
+ if ($(parent).length == 0) {
+ return;
+ }
+
+ var linkId = $(parent).attr('id').split('_', 2)[1];
+ var zoomImage = 'data/links/zoom_' + linkId + '.jpg';
+
+
// Calculate best scale factor to fit and also to honour the maxZoom level
zoomScale = Math.min((availableWidth / box.width), (availableHeight / box.height), maxZoom);
z.show();
var s = (zoomWidth / box.width);
- $(".zoomPopupClose").css('opacity', 1).transform({scale: 1 / s, origin: ['100%', '0', 0]});
+ $(".zoomPopupClose").css('opacity', 0).transform({scale: 1 / s, origin: ['100%', '0', 0]});
setTimeout(function () {
z.css({
boxShadow: '0 0 100px rgba(0,0,0,0.3)',
});
}, 50);
+ setTimeout(function () {
+ $(".zoomPopupClose").css('opacity', '');
+ }, 500);
+
z.data('scale', zoomScale);
// Show overlay
$('body').addClass('zoomPopup');
var z = $('#zoomPopupWrapper'),
scale = z.data('scale');
+ $(".zoomPopupClose").css('opacity', '0');
+
z.css({
transform: 'translate(0,0) scale(1)',
boxShadow: '0 0 0 rgba(0,0,0,0.3)',
// ToDo: see https://davidwalsh.name/css-animation-callback
setTimeout(function () {
$('#zoomPopupWrapper').hide();
- $(".zoomPopupClose").css('opacity', 0);
$('body').removeClass('zoomPopup');
}, 500);
attrs = {};
}
if (attrs.viewBox == null) {
- attrs.viewBox = $('svg symbol#'+icon).get(0).attributes.viewBox.value;
+ attrs.viewBox = $('svg symbol#' + icon).get(0).attributes.viewBox.value;
}
$.each(attrs, function (k, v) {
a.push(k + '="' + v + '"');
});
return '<svg ' + a.join(' ') + '><use xlink:href="#' + icon + '" /></svg>';
+}
+
+function blur() {
+ if ($(":focus").length > 0) {
+ var tmp = document.createElement("input");
+ document.body.appendChild(tmp);
+ tmp.focus();
+ document.body.removeChild(tmp);
+ }
}
\ No newline at end of file