Skip to content

Commit

Permalink
rtl title and left panel contents
Browse files Browse the repository at this point in the history
  • Loading branch information
edsilv committed Oct 18, 2023
1 parent 766b29c commit 1f2cdcf
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export class TreeView extends BaseView {
this.setConfig("contentLeftPanel");
super.create();

this.$tree = $('<div class="iiif-tree-component"></div>');
this.$tree = $('<div class="iiif-tree-component rtl"></div>');
this.$element.append(this.$tree);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,11 @@
font-weight: normal;
overflow: auto;

.iiif-tree-component.rtl {
direction: rtl;
padding-right: @padding-medium-horizontal;
}

.iiif-tree-component ul li a.selected {
color: @brand-primary !important;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -594,7 +594,7 @@ export class OpenSeadragonCenterPanel extends CenterPanel {
maxLevel: info.levels - 1,
units: "mm",
spacing: [info.mm_x, info.mm_y],
getTileUrl: function (level, x, y, query) {
getTileUrl: function(level, x, y, query) {
var url =
tileDescriptor + "/zxy/" + level + "/" + x + "/" + y;
if (query) {
Expand Down Expand Up @@ -947,9 +947,9 @@ export class OpenSeadragonCenterPanel extends CenterPanel {
const canvas: Canvas = this.extension.helper.getCurrentCanvas();
const dimensions: CroppedImageDimensions | null = (this
.extension as OpenSeadragonExtension).getCroppedImageDimensions(
canvas,
this.viewer
);
canvas,
this.viewer
);

if (dimensions) {
const bounds: XYWHFragment = new XYWHFragment(
Expand Down Expand Up @@ -985,7 +985,7 @@ export class OpenSeadragonCenterPanel extends CenterPanel {
if (!center) return;

// postpone pan for a millisecond - fixes iPad image stretching/squashing issue.
setTimeout(function () {
setTimeout(function() {
viewer.viewport.panTo(center, true);
}, 1);
}
Expand Down Expand Up @@ -1296,10 +1296,6 @@ export class OpenSeadragonCenterPanel extends CenterPanel {

if (!this.isCreated) return;

if (this.title) {
this.$title.text(sanitize(this.title));
}

this.$spinner.css(
"top",
this.$content.height() / 2 - this.$spinner.height() / 2
Expand All @@ -1313,6 +1309,17 @@ export class OpenSeadragonCenterPanel extends CenterPanel {
this.extension.helper.getViewingDirection() ||
ViewingDirection.LEFT_TO_RIGHT;

if (this.title) {
this.$title.text(sanitize(this.title));
}

// if the manifest has a right-to-left viewing direction, add a class to the title to display it rtl
if (this.extension.helper.isRightToLeft()) {
this.$title.addClass("rtl");
} else {
this.$title.removeClass("rtl");
}

if (
this.extension.helper.isMultiCanvas() &&
this.$prevButton &&
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@
text-overflow: ellipsis;
line-height: 30px;

&.rtl {
direction: rtl;
}

.xl-mediaquery({
padding: 0 20px 0 20px;
});
Expand Down

1 comment on commit 1f2cdcf

@vercel
Copy link

@vercel vercel bot commented on 1f2cdcf Oct 18, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.