Commit 10e8c152 by Lynette Lizardo

implemented shorcuts

parent 5779ec31
......@@ -21,6 +21,21 @@ export class ImageViewer {
highLightCanvasID;
highlightObject;
imageControls = {
fitContentButton: null,
flipVerticalButton: null,
flipHorizontalButton: null,
rotateLeftButton: null,
rotateRightButton: null,
zoomInButton: null,
zoomOutBtn: null,
nextPageButton: null,
previousPageButton: null,
refreshButton: null,
previousImageButton:null,
nextImageButton: null
}
constructor(imageContainerID) {
this.imageContainerID = imageContainerID;
}
......@@ -42,6 +57,21 @@ export class ImageViewer {
this.nextPageButton.addEventListener("click", () => { this.nextPageFunction(this.currentImageObject) });
this.previousPageButton.addEventListener("click", () => { this.previousPageFunction(this.currentImageObject) });
this.imageControls.fitContentButton = document.getElementById("fitContentBtn");
this.imageControls.flipVerticalButton = document.getElementById("flipVerticalBtn");
this.imageControls.flipHorizontalButton = document.getElementById("flipHorizontalBtn");
this.imageControls.rotateLeftButton = document.getElementById("leftRotateBtn");
this.imageControls.rotateRightButton = document.getElementById("rightRotateBtn");
this.imageControls.zoomInButton = document.getElementById("zoomInBtn");
this.imageControls.zoomOutBtn = document.getElementById("zoomOutBtn");
this.imageControls.nextPageButton = document.getElementById("nextPageBtn");
this.imageControls.previousPageButton = document.getElementById("previousPageBtn");
this.imageControls.refreshButton = document.getElementById("refreshCurrentImage");
this.imageControls.previousImageButton = document.getElementById("previousRecordImage");
this.imageControls.nextImageButton = document.getElementById("nextRecordImage");
}
async addImage(imageID, imageType, imageName, imageBlob) {
......@@ -196,7 +226,7 @@ export class ImageViewer {
if (object) {
this.nextImageObject = object;
} else {
this.nextImageObject = this.currentImageObject ;
this.nextImageObject = this.currentImageObject;
if (document.getElementById(this.nextImageID)) {
document.getElementById(this.nextImageID).remove();
}
......@@ -262,7 +292,7 @@ export class ImageViewer {
}
document.getElementById(_this.currentImageID).childNodes.forEach(element => {
if(!element.classList.includes("image")){
if (!element.classList.includes("image")) {
element.classList.add("image");
}
});
......@@ -363,13 +393,13 @@ export class ImageViewer {
console.log(scale);
}
const container = document.getElementById(_this.currentImageID);
if(container.getAttribute("file-type") !== "pdf"){
if (container.getAttribute("file-type") !== "pdf") {
container.childNodes.forEach(element => {
element.classList.remove("image");
});
}else{
} else {
container.childNodes.forEach(element => {
if(!element.classList.includes("image")){
if (!element.classList.includes("image")) {
element.classList.add("image");
}
});
......@@ -382,8 +412,8 @@ export class ImageViewer {
if (highlight) {
highlight.style.zoom = scale;
//highlight.style.transform = "scale(" + scale + ")";
// highlight.style.transformOrigin = (scale * 100) + "% " + (scale * 100) + "%";
// highlight.style.transformOrigin = (scale * 100) + "% " + (scale * 100) + "%";
}
});
......
......@@ -207,6 +207,10 @@ export class DocumentControlWidget {
return this.global.refreshBtn;
}
getSubmitBtn(){
return this.global.submitBtn;
}
getPauseBtn() {
return this.global.pauseBtn;
}
......
......@@ -110,6 +110,7 @@ h3{
#shortcut-popUp div table tr td{
border-bottom: 1px solid #fff !important;
margin-bottom: 2px !important;
color:#fff;
}
......
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