mirror of
https://github.com/9001/copyparty.git
synced 2026-01-12 15:52:39 -07:00
bbox: copy rotation to next pic
This commit is contained in:
parent
c0e167fd97
commit
485c60cf25
|
|
@ -1014,7 +1014,9 @@ window.baguetteBox = (function () {
|
||||||
if (index >= imagesElements.length)
|
if (index >= imagesElements.length)
|
||||||
return bounceAnimation(options.readDirRtl ? 'left' : 'right');
|
return bounceAnimation(options.readDirRtl ? 'left' : 'right');
|
||||||
|
|
||||||
|
var orot;
|
||||||
try {
|
try {
|
||||||
|
orot = vidimg().getAttribute('rot');
|
||||||
vid().pause();
|
vid().pause();
|
||||||
}
|
}
|
||||||
catch (ex) { }
|
catch (ex) { }
|
||||||
|
|
@ -1032,6 +1034,9 @@ window.baguetteBox = (function () {
|
||||||
else if (toast.tag == 'bb-ded')
|
else if (toast.tag == 'bb-ded')
|
||||||
toast.hide();
|
toast.hide();
|
||||||
|
|
||||||
|
if (orot && im.getAttribute('rot') === null)
|
||||||
|
rotn(orot / 90, 1);
|
||||||
|
|
||||||
if (options.animation == 'none')
|
if (options.animation == 'none')
|
||||||
unvid(vid());
|
unvid(vid());
|
||||||
else
|
else
|
||||||
|
|
@ -1048,7 +1053,7 @@ window.baguetteBox = (function () {
|
||||||
}
|
}
|
||||||
|
|
||||||
var prev_cw = 0, prev_ch = 0, unrot_timer = null;
|
var prev_cw = 0, prev_ch = 0, unrot_timer = null;
|
||||||
function rotn(n) {
|
function rotn(n, asap) {
|
||||||
var el = vidimg(),
|
var el = vidimg(),
|
||||||
orot = parseInt(el.getAttribute('rot') || 0),
|
orot = parseInt(el.getAttribute('rot') || 0),
|
||||||
frot = orot + (n || 0) * 90;
|
frot = orot + (n || 0) * 90;
|
||||||
|
|
@ -1063,6 +1068,8 @@ window.baguetteBox = (function () {
|
||||||
if (!n && prev_cw === cw && prev_ch === ch)
|
if (!n && prev_cw === cw && prev_ch === ch)
|
||||||
return; // reflow noop
|
return; // reflow noop
|
||||||
|
|
||||||
|
clmod(el, 'asap', asap);
|
||||||
|
|
||||||
prev_cw = cw;
|
prev_cw = cw;
|
||||||
prev_ch = ch;
|
prev_ch = ch;
|
||||||
var rot = frot,
|
var rot = frot,
|
||||||
|
|
@ -1076,8 +1083,8 @@ window.baguetteBox = (function () {
|
||||||
wmag = Math.min(vw / iw, vh / ih);
|
wmag = Math.min(vw / iw, vh / ih);
|
||||||
|
|
||||||
if (!options.bbzoom) {
|
if (!options.bbzoom) {
|
||||||
pmag = Math.min(1, pmag);
|
pmag = Math.min(1, pmag);
|
||||||
wmag = Math.min(1, wmag);
|
wmag = Math.min(1, wmag);
|
||||||
}
|
}
|
||||||
|
|
||||||
while (rot < 0) rot += 360;
|
while (rot < 0) rot += 360;
|
||||||
|
|
@ -1122,7 +1129,7 @@ window.baguetteBox = (function () {
|
||||||
return;
|
return;
|
||||||
|
|
||||||
clmod(el, 'nt', 1);
|
clmod(el, 'nt', 1);
|
||||||
el.removeAttribute('rot');
|
el.setAttribute('rot', 0);
|
||||||
el.removeAttribute("style");
|
el.removeAttribute("style");
|
||||||
rot = el.offsetHeight;
|
rot = el.offsetHeight;
|
||||||
clmod(el, 'nt');
|
clmod(el, 'nt');
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue