Updated Rotate Left/Right shortcut funtions to update inmediatly
Minor fixes
This commit is contained in:
parent
e2eab808c0
commit
bf12542df5
|
@ -388,8 +388,9 @@ function setImage(url, _canvas) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// reloadImages is a slow process when multiple images are involved. Only used when rotating/mirroring
|
||||||
function reloadImages() {
|
function reloadImages() {
|
||||||
for(i=0; imageFiles.length; i++) {
|
for(i=0; i < imageFiles.length; i++) {
|
||||||
setImage(imageFiles[i].dataURI, $(".mainImage")[i]);
|
setImage(imageFiles[i].dataURI, $(".mainImage")[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -511,6 +512,7 @@ function keyHandler(evt) {
|
||||||
settings.rotateTimes = 3;
|
settings.rotateTimes = 3;
|
||||||
}
|
}
|
||||||
updatePage();
|
updatePage();
|
||||||
|
reloadImages();
|
||||||
break;
|
break;
|
||||||
case kthoom.Key.R:
|
case kthoom.Key.R:
|
||||||
if (hasModifier) break;
|
if (hasModifier) break;
|
||||||
|
@ -519,6 +521,7 @@ function keyHandler(evt) {
|
||||||
settings.rotateTimes = 0;
|
settings.rotateTimes = 0;
|
||||||
}
|
}
|
||||||
updatePage();
|
updatePage();
|
||||||
|
reloadImages();
|
||||||
break;
|
break;
|
||||||
case kthoom.Key.F:
|
case kthoom.Key.F:
|
||||||
if (hasModifier) break;
|
if (hasModifier) break;
|
||||||
|
@ -534,6 +537,7 @@ function keyHandler(evt) {
|
||||||
settings.hflip = true;
|
settings.hflip = true;
|
||||||
}
|
}
|
||||||
updatePage();
|
updatePage();
|
||||||
|
reloadImages();
|
||||||
break;
|
break;
|
||||||
case kthoom.Key.W:
|
case kthoom.Key.W:
|
||||||
if (hasModifier) break;
|
if (hasModifier) break;
|
||||||
|
@ -663,7 +667,6 @@ function init(filename) {
|
||||||
settings[this.name] = value;
|
settings[this.name] = value;
|
||||||
|
|
||||||
if(["hflip", "vflip", "rotateTimes"].includes(this.name)) {
|
if(["hflip", "vflip", "rotateTimes"].includes(this.name)) {
|
||||||
//reloadImages is a slow process when multiple images are involved. Only used when rotating/mirroring
|
|
||||||
reloadImages();
|
reloadImages();
|
||||||
} else if(this.name === "direction") {
|
} else if(this.name === "direction") {
|
||||||
return updateProgress();
|
return updateProgress();
|
||||||
|
@ -676,6 +679,7 @@ function init(filename) {
|
||||||
// Close modal
|
// Close modal
|
||||||
$(".closer, .overlay").click(function() {
|
$(".closer, .overlay").click(function() {
|
||||||
$(".md-show").removeClass("md-show");
|
$(".md-show").removeClass("md-show");
|
||||||
|
$("#mainContent").focus(); // focus back on the main container so you use up/down keys without having to click on it
|
||||||
});
|
});
|
||||||
|
|
||||||
// TOC thumbnail pagination
|
// TOC thumbnail pagination
|
||||||
|
@ -688,7 +692,7 @@ function init(filename) {
|
||||||
if (typeof screenfull !== "undefined") {
|
if (typeof screenfull !== "undefined") {
|
||||||
$("#fullscreen").click(function() {
|
$("#fullscreen").click(function() {
|
||||||
screenfull.toggle($("#container")[0]);
|
screenfull.toggle($("#container")[0]);
|
||||||
// Focus so you can use up/down keys immediately after fullscreen
|
// Focus on main container so you can use up/down keys immediately after fullscreen
|
||||||
$("#mainContent").focus();
|
$("#mainContent").focus();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -749,7 +753,7 @@ function init(filename) {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
//Scrolling up/down will update current image if a new image is into view (for Long Strip Display)
|
// Scrolling up/down will update current image if a new image is into view (for Long Strip Display)
|
||||||
$("#mainContent").scroll(function(){
|
$("#mainContent").scroll(function(){
|
||||||
var scroll = $("#mainContent").scrollTop();
|
var scroll = $("#mainContent").scrollTop();
|
||||||
if(settings.pageDisplay === 0) {
|
if(settings.pageDisplay === 0) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user