Commit 49960b96 authored by gijs's avatar gijs

Fix panel behaviour on mobile?

parent 0d8d5731
......@@ -598,4 +598,12 @@ h3 {
min-height: 100%;
padding: 0;
} */
[data-container-panel-toggle="previous"] {
padding: 1em 0 0 1em;
}
[data-container-panel-toggle="next"] {
padding: 1em 1em 0 0;
}
}
\ No newline at end of file
......@@ -524,6 +524,14 @@ div.social {
top: -3px;
padding-top: 5px;
}
[data-container-panel-toggle="previous"] {
padding: 1em 0 0 1em;
}
[data-container-panel-toggle="next"] {
padding: 1em 1em 0 0;
}
}
@media screen and (max-width: 400px) {
......
......@@ -293,14 +293,16 @@
panel = findPanel(toggle);
toggle.addEventListener('mousedown', startMove);
toggle.addEventListener('touchstart', startMove);
toggle.addEventListener('mouseenter', function () {
if (panel.dataset.active !== 'true') {
shiftContainer(container, (panel.dataset.panelPosition === 'left') ? 30 : -30);
}
});
toggle.addEventListener('mouseleave', function () {
shiftContainer(container, 0);
});
if (!document.ontouchstart) {
toggle.addEventListener('mouseenter', function () {
if (panel.dataset.active !== 'true') {
shiftContainer(container, (panel.dataset.panelPosition === 'left') ? 30 : -30);
}
});
toggle.addEventListener('mouseleave', function () {
shiftContainer(container, 0);
});
}
})()
}
}
......@@ -343,8 +345,10 @@
if (togglePrevious) {
if (previous) {
togglePrevious.onmouseenter = function () { shiftContainer(container, 30); };
togglePrevious.onmouseleave = function () { shiftContainer(container, 0); };
if (!document.ontouchstart) {
togglePrevious.onmouseenter = function () { shiftContainer(container, 30); };
togglePrevious.onmouseleave = function () { shiftContainer(container, 0); };
}
togglePrevious.onclick = function () { showPanel(previous) };
togglePrevious.dataset.active = "true";
} else {
......@@ -357,10 +361,10 @@
if (toggleNext) {
if (next) {
toggleNext.onmouseenter = function () {
shiftContainer(container, -30); };
toggleNext.onmouseleave = function () {
shiftContainer(container, 0); };
if (!document.ontouchstart) {
toggleNext.onmouseenter = function () { shiftContainer(container, -30); };
toggleNext.onmouseleave = function () { shiftContainer(container, 0); };
}
toggleNext.onclick = function () { showPanel(next) };
toggleNext.dataset.active = "true";
} else {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment