Skip to content
Snippets Groups Projects
Commit 104d409b authored by smayer's avatar smayer
Browse files

Fix JS for displaying selected articles with new IIIF URLs

parent 7fcc1223
No related branches found
No related tags found
1 merge request!2Merging development into onb as preparation for Annolyzer release
......@@ -165,7 +165,7 @@ export default class extends Controller {
// Go to article page and select it
let article = this.articlesValue.filter((obj) => { return obj["id"] == articleId})[0]
let pagenum = article.canvases_parts[0]
pagenum = parseInt(pagenum.substring(pagenum.lastIndexOf('_')+1, pagenum.lastIndexOf("#xywh")))
pagenum = parseInt(pagenum.substring(pagenum.lastIndexOf('/')+1, pagenum.lastIndexOf("#xywh")))
// this.viewer.goToPage(pagenum)
// this.viewer.viewport.zoomTo(2)
// this.viewer.viewport.panTo(new OpenSeadragon.Point(loc.x+loc.width/2, loc.y+loc.height/2))
......@@ -361,7 +361,7 @@ export default class extends Controller {
$(this.addArticleButtonTarget).addClass("d-none")
const first_article_part = this.articlesValue.filter((elt)=>{return elt.id == this.selectedCompound.parts[0]})[0]
const pagenum = first_article_part.canvases_parts[0]
initialPage = parseInt(pagenum.substring(pagenum.lastIndexOf('_')+1, pagenum.lastIndexOf("#xywh")))-1
initialPage = parseInt(pagenum.substring(pagenum.lastIndexOf('/')+1, pagenum.lastIndexOf("#xywh")))-1
}
else {
initialPage = 0
......@@ -372,7 +372,7 @@ export default class extends Controller {
else {
$(this.addArticleButtonTarget).removeClass("d-none")
const pagenum = selectedArticleObject.canvases_parts[0]
initialPage = parseInt(pagenum.substring(pagenum.lastIndexOf('_')+1, pagenum.lastIndexOf("#xywh")))-1
initialPage = parseInt(pagenum.substring(pagenum.lastIndexOf('/')+1, pagenum.lastIndexOf("#xywh")))-1
}
this.viewer = OpenSeadragon({
id: "openseadragon_view",
......@@ -407,7 +407,7 @@ export default class extends Controller {
this.viewer.addHandler("open", (data) => {
for (let article of this.articlesValue) {
let pagenum = article.canvases_parts[0]
pagenum = parseInt(pagenum.substring(pagenum.lastIndexOf('_')+1, pagenum.lastIndexOf("#xywh")))
pagenum = parseInt(pagenum.substring(pagenum.lastIndexOf('/')+1, pagenum.lastIndexOf("#xywh")))
if (pagenum === this.currentPageValue) {
let bbox = article.bbox
let loc = this.viewer.viewport.imageToViewportRectangle(bbox[0], bbox[1], bbox[2], bbox[3])
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment