Skip to content

Commit 717b666

Browse files
authored
Merge pull request #64 from jamesmisson/uv-issue-1503-behavior-continuous
Add getBehavior and include continuous behavior in isContinuous
2 parents f3a7068 + b568cc9 commit 717b666

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

src/Helper.ts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import { MultiSelectableCanvas } from "./MultiSelectableCanvas";
88
import { TreeSortType } from "./TreeSortType";
99
import { MultiSelectableRange } from "./MultiSelectableRange";
1010
import {
11+
Behavior,
1112
ServiceProfile,
1213
ViewingHint,
1314
ViewingDirection,
@@ -969,6 +970,21 @@ export class Helper {
969970
return viewingHint;
970971
}
971972

973+
public getBehavior(): Behavior | null {
974+
if (!this.manifest) {
975+
throw new Error(Errors.manifestNotLoaded);
976+
}
977+
978+
let behavior: Behavior | null =
979+
this.getCurrentRange()?.getBehavior() ?? null;
980+
981+
if (!behavior) {
982+
behavior = this.manifest.getBehavior();
983+
}
984+
985+
return behavior;
986+
}
987+
972988
// inquiries //
973989

974990
public hasParentCollection(): boolean {
@@ -1015,6 +1031,12 @@ export class Helper {
10151031
return viewingHint === ViewingHint.CONTINUOUS;
10161032
}
10171033

1034+
const behavior: Behavior | null = this.getBehavior();
1035+
1036+
if (behavior) {
1037+
return behavior === Behavior.CONTINUOUS;
1038+
}
1039+
10181040
return false;
10191041
}
10201042

0 commit comments

Comments
 (0)