Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -207,8 +207,8 @@ export default class OpenSeadragonExtension extends BaseExtension<Config> {
);

this.extensionHost.subscribe(IIIFEvents.LEFTPANEL_EXPAND_FULL_START, () => {
this.shell.$centerPanel.hide();
this.shell.$rightPanel.hide();
/* this.shell.$centerPanel.hide();
this.shell.$rightPanel.hide(); */
});

this.extensionHost.subscribe(IIIFEvents.MINUS, () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,8 @@ export class BaseExpandPanel<T extends ExpandPanel> extends BaseView<T> {

autoToggled ? (this.autoToggled = true) : (this.autoToggled = false);

this.$element.toggleClass("open");

// if collapsing, hide contents immediately.
if (this.isExpanded) {
this.$top.attr("aria-hidden", "true");
Expand All @@ -118,7 +120,19 @@ export class BaseExpandPanel<T extends ExpandPanel> extends BaseView<T> {
this.$closed.show();
}

// to allow for the css transition to finish
// TODO: get this var from config and make sure css uses the same
// although make sure it is +50 to allow for lag
// and re-introduce the animation check
if (isReducedAnimation) {
this.toggled();
} else {
setTimeout(() => {
this.toggled();
}, 300);
}

/* if (isReducedAnimation) {
// This is reduced motion.
this.$element.css("width", this.getTargetWidth());
this.$element.css("left", this.getTargetLeft());
Expand All @@ -135,7 +149,7 @@ export class BaseExpandPanel<T extends ExpandPanel> extends BaseView<T> {
this.toggled();
}
);
}
} */
}

toggled(): void {
Expand All @@ -159,19 +173,31 @@ export class BaseExpandPanel<T extends ExpandPanel> extends BaseView<T> {
}

expandFull(): void {
if (!this.isExpanded) {
this.toggled();
}
console.log("BaseExpandPanel.ts:expandFull()");

const settings = this.extension.getSettings();
let isReducedAnimation = settings.reducedAnimation;

var targetWidth: number = this.getFullTargetWidth();
var targetLeft: number = this.getFullTargetLeft();
/* var targetWidth: number = this.getFullTargetWidth();
var targetLeft: number = this.getFullTargetLeft(); */

this.expandFullStart();

if (isReducedAnimation) {
if (!this.isExpanded) {
this.toggled();
}
this.expandFullFinish();
} else {
setTimeout(() => {
if (!this.isExpanded) {
this.toggled();
}
this.expandFullFinish();
}, 550);
}

/* if (isReducedAnimation) {
this.$element.css("width", targetWidth);
this.$element.css("left", targetLeft);
this.expandFullFinish();
Expand All @@ -186,7 +212,7 @@ export class BaseExpandPanel<T extends ExpandPanel> extends BaseView<T> {
this.expandFullFinish();
}
);
}
} */
}

collapseFull(): void {
Expand Down
33 changes: 33 additions & 0 deletions src/content-handlers/iiif/modules/uv-shared-module/LeftPanel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,4 +67,37 @@ export class LeftPanel<
this.$element.width(this.$element.parent().width());
}
}

toggle(autoToggled?: boolean): void {
if (this.isExpanded) {
this.$element.parent().removeClass("leftPanelOpen");
} else {
this.$element.parent().addClass("leftPanelOpen");
}

super.toggle(autoToggled);
}

expandFull(): void {
console.log("LeftPanel.ts:expandFull()");

this.$element.parent().addClass("leftPanelOpenFull");
super.expandFull();
}

collapseFull(): void {
console.log("LeftPanel.ts:collapseFull()");

this.$element.parent().removeClass("leftPanelOpenFull");

// need this because 'closing' full width shouldn't actually do that
// if puts the left panel back to normal open state
// but if the left panel was previously closed, this class won't be present
// so we put it back
if (!this.$element.parent().hasClass("leftPanelOpen")) {
this.$element.parent().addClass("leftPanelOpen");
}

super.collapseFull();
}
}
14 changes: 14 additions & 0 deletions src/content-handlers/iiif/modules/uv-shared-module/RightPanel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,18 @@ export class RightPanel<T extends ExpandPanel> extends BaseExpandPanel<T> {
),
});
}

toggle(autoToggled?: boolean): void {
if (this.isExpanded) {
this.$element.parent().removeClass("rightPanelOpen");
} else {
this.$element.parent().addClass("rightPanelOpen");
}

super.toggle(autoToggled);
}

expandFull(): void {
super.expandFull();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
.hidden();
}

.mainPanel {
/* .mainPanel {

.leftPanel {
.hidden();
Expand All @@ -13,7 +13,7 @@
.rightPanel {
.hidden();
}
}
} */

.footerPanel {
.hidden();
Expand Down
29 changes: 29 additions & 0 deletions src/content-handlers/iiif/modules/uv-shared-module/css/lg.less
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,33 @@

}
}

.lg-mediaquery({
.headerPanel {
display: block;
visibility: visible;
}

.mainPanel {
.leftPanel {
display: block;
visibility: visible;
}

.rightPanel {
display: block;
visibility: visible;
}
}

.footerPanel {
display: block;
visibility: visible;
}

.mobileFooterPanel {
display: none;
visibility: hidden;
}
})
}
29 changes: 29 additions & 0 deletions src/content-handlers/iiif/modules/uv-shared-module/css/md.less
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,33 @@

}

.md-mediaquery({
.headerPanel {
display: block;
visibility: visible;
}

.mainPanel {
.leftPanel {
display: block;
visibility: visible;
}

.rightPanel {
display: block;
visibility: visible;
}
}

.footerPanel {
display: block;
visibility: visible;
}

.mobileFooterPanel {
display: none;
visibility: hidden;
}
})

}
Original file line number Diff line number Diff line change
Expand Up @@ -26,26 +26,6 @@
}
}

.only-desktop() {
display: var(--uv-desktop-display, none);
visibility: var(--uv-desktop-visibility, hidden);
}

.only-mobile() {
display: var(--uv-mobile-display, block);
visibility: var(--uv-mobile-visibility, visible);
}

:root {
.md-mediaquery({
--uv-mobile-display: none;
--uv-mobile-visibility: hidden;

--uv-desktop-display: block;
--uv-desktop-visibility: visible;
});
}


// end media queries

Expand Down
28 changes: 28 additions & 0 deletions src/content-handlers/iiif/modules/uv-shared-module/css/sm.less
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,32 @@
}
}

.sm-mediaquery({
.headerPanel {
display: none;
visibility: hidden;
}

/* .mainPanel {
.leftPanel {
display: none;
visibility: hidden;
}

.rightPanel {
display: none;
visibility: hidden;
}
} */

.footerPanel {
display: none;
visibility: hidden;
}

.mobileFooterPanel {
display: block;
visibility: visible;
}
})
}
Loading