-<svg id="SvgjsSvg1008" xmlns="http://www.w3.org/2000/svg" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svgjs="http://svgjs.com/svgjs" width="17" height="17" viewBox="0 0 17 17"><title>Shape 2</title><desc>Created with Avocode.</desc><defs id="SvgjsDefs1009"></defs><path id="SvgjsPath1010" d="M0.01472 2.13604L2.13604 0.014720000000000066L16.98528 14.86396L14.863959999999999 16.98528Z " fill="#f5f5f5" fill-opacity="1" transform="matrix(1,0,0,1,0,0)"></path><path id="SvgjsPath1011" d="M2.13604 16.98528L0.014720000000000066 14.863959999999999L14.86396 0.014719999999998734L16.98528 2.1360399999999986Z " fill="#f5f5f5" fill-opacity="1" transform="matrix(1,0,0,1,0,0)"></path></svg>
\ No newline at end of file
+<svg xmlns="http://www.w3.org/2000/svg" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svgjs="http://svgjs.com/svgjs" width="17" height="17" viewBox="0 0 17 17"><path id="p1" class="" d="M0.01472 2.13604L2.13604 0.014720000000000066L16.98528 14.86396L14.863959999999999 16.98528Z " fill="#f5f5f5" fill-opacity="1" transform="matrix(1,0,0,1,0,0)"></path><path id="p2" d="M2.13604 16.98528L0.014720000000000066 14.863959999999999L14.86396 0.014719999999998734L16.98528 2.1360399999999986Z " fill="#f5f5f5" fill-opacity="1" transform="matrix(1,0,0,1,0,0)"></path></svg>
\ No newline at end of file
--- /dev/null
+<svg xmlns="http://www.w3.org/2000/svg" style="display: none;">
+ <symbol viewBox="0 0 17 17" id="close">
+ <path id="p1" class="fill-c-menu-text" d="M0.01472 2.13604L2.13604 0.014720000000000066L16.98528 14.86396L14.863959999999999 16.98528Z" fill-opacity="1" transform="matrix(1,0,0,1,0,0)"></path>
+ <path id="p2" class="fill-c-menu-text" d="M2.13604 16.98528L0.014720000000000066 14.863959999999999L14.86396 0.014719999999998734L16.98528 2.1360399999999986Z" fill-opacity="1" transform="matrix(1,0,0,1,0,0)"></path>
+ </symbol>
+</svg>
\ No newline at end of file
});
// ToDo: consider re-using existing popinOverlay div?
- $('body').append('<div id="zoomPopupOverlay"></div><div id="zoomPopupWrapper"><a href="#" class="zoomPopupClose"></a></div>');
+ $('body').append('<div id="zoomPopupOverlay"></div><div id="zoomPopupWrapper"><a href="#" class="zoomPopupClose"><svg viewBox="0 0 20 20"><use xlink:href="#close"></use></svg></a></div>');
- $(document).on('click', '.zoomPopup', function (e) {
+ $(document).on('click touchend', '.zoomPopup', function (e) {
e.preventDefault();
$this.zoomLink(this);
return false;
});
- $(document).on('click touchend', '#zoomPopupOverlay, .zoomPopupClose', function (e) {
+ $(this.fluidbook).on('fluidbook.zoom.in.end', function () {
+ $this.zoomLinkReset(true);
+ return true;
+ });
+
+ $(document).on('click touchend', '#zoomPopupOverlay, #zoomPopupWrapper', function (e) {
console.log('closing zoomPopup...');
$this.zoomLinkReset();
});
$this.zoomLink(link);
});
+
// Zoom out
this.fluidbook.zoom.resetZoom();
return false;
this.fluidbook.hideLoader();
z.show();
+ var s = (zoomWidth / box.width);
+ $(".zoomPopupClose").css('opacity', 1).transform({scale: 1 / s, origin: ['100%', '0', 0]});
setTimeout(function () {
z.css({
- transform: 'translateX(' + x + 'px) translateY(' + y + 'px)',
- width: zoomWidth,
- height: zoomHeight
+ boxShadow: '0 0 100px rgba(0,0,0,0.3)',
+ transform: 'translateX(' + x + 'px) translateY(' + y + 'px) scale(' + s + ')',
});
}, 50);
});
},
- zoomLinkReset: function () {
+ zoomLinkReset: function (immediate) {
+ if (immediate == undefined) {
+ immediate = false;
+ }
if (!$('body').hasClass('zoomPopup')) return false; // Already open
scale = z.data('scale');
z.css({
- transform: 'translate(0,0)',
- width: z.width() / scale,
- height: z.height() / scale
+ transform: 'translate(0,0) scale(1)',
+ boxShadow: '0 0 0 rgba(0,0,0,0.3)',
});
+ if (immediate) {
+ $('#zoomPopupWrapper').hide();
+ $('body').removeClass('zoomPopup');
+ }
// Hide popup after transition completes
// ToDo: use CSS transition end event to do this without needing a timeout value (or use Web Animation API)
// ToDo: see https://davidwalsh.name/css-animation-callback
setTimeout(function () {
$('#zoomPopupWrapper').hide();
+ $(".zoomPopupClose").css('opacity', 0);
$('body').removeClass('zoomPopup');
}, 500);
- //z.attr('style', '');
-
return false;
}