Commit 275d8a71 authored by njean42's avatar njean42
Browse files

Previous panel/page buutton.

parent 3572dd0c
......@@ -115,8 +115,6 @@ class Reader {
if (was_zoomed)
this.gotoPanel(this.currpanel);
this.showMenu(false);
this.gui.children('.pagenb').stop().fadeIn(500, function () { $(this).fadeOut(3000); });
return true;
}
......@@ -199,7 +197,6 @@ class Reader {
if (!nextpage)
this.currpanel--;
}
this.showMenu(false);
}
nextPanel () { this.currpanel++; this.gotoPanel(this.currpanel); }
prevPanel () { this.currpanel--; this.gotoPanel(this.currpanel); }
......@@ -246,19 +243,21 @@ class Reader {
var burger = $('<i class="burger">☰</i>');
burger.data('reader',this);
burger.on('click touch', function (e) {
$(this).data('reader').showMenu();
e.stopPropagation();
});
burger.on('click touch', function (e) { $(this).data('reader').showMenu(); });
this.gui.append(burger);
var btprev = $('<i class="prev">←</i>');
btprev.data('reader',this);
btprev.on('click touch', function (e) { $(this).data('reader').prev(); });
this.gui.append(btprev);
var menu = $('<div class="menu"/>');
var menuul = $('<ul/>');
menuul.append('<li><label><input type="radio" name="viewmode" value="page" autocomplete="off" />Page</label></li>');
menuul.append('<li><label><input type="radio" name="viewmode" value="panel" autocomplete="off" />Panel</label></li>');
menu.append(menuul);
var btn_debug = $('<label><input type="checkbox" class="toggleDebug" />Show panels</label>');
var btn_debug = $('<label><input type="checkbox" class="toggleDebug" autocomplete="off" />Show panels</label>');
btn_debug.children('.toggleDebug').on('change', function () { _reader.gui.toggleClass('debug'); });
menuul.append(btn_debug);
......@@ -298,19 +297,9 @@ class Reader {
showMenu(show=true)
{
if (show)
{
this.gui.children('.menu').show();
this.gui.children('.burger').hide();
}
else
{
this.gui.children('.menu').hide();
this.gui.children('.burger').show();
}
}
toggleMenu()
{
this.showMenu(!this.gui.children('.menu').is(':visible'));
}
}
......@@ -363,10 +352,6 @@ $(document).keydown(function(e) {
$('input[name=viewmode]:not(:checked)').prop('checked',true).change();
break;
case 77: // 'm' key: show/hide menu
reader.toggleMenu();
break;
default:
return; // exit this handler for other keys
}
......
......@@ -28,9 +28,9 @@ ul {
position: relative;
}
.page-nb, .burger, .menu > ul {
.pagenb, .burger, .prev, .menu > ul {
z-index: 20;
padding: 0.3em 0.5em;
padding: 0.1em 0.4em;
background-color: #34495e;
opacity: 0.9;
color: #ecf0f1;
......@@ -60,19 +60,37 @@ ul {
top: 1vmin;
font-style: normal;
}
.burger {
/* Fading corner icons/infos */
.prev {
position: absolute;
top: 0;
left: 0;
bottom: 0;
font-size: 6vmin;
font-style: normal;
}
.burger {
position: absolute;
top: 0;
right: 0;
font-size: 6vmin;
font-style: normal;
}
.pagenb {
position: absolute;
bottom: 0;
right: 0;
}
.prev, .burger, .pagenb {
transition-property: opacity;
transition-duration: 2s;
opacity: 0.1;
}
.prev:active, .burger:active, .pagenb:active {
transition-duration: 0s;
opacity: 1;
}
.license {
position: absolute;
......
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