@panoramax/web-viewer 3.2.3-develop-367cb599 → 3.2.3-develop-00ee44cd
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +4 -0
- package/build/index.js +3 -3
- package/build/index.js.map +1 -1
- package/docs/03_URL_settings.md +1 -1
- package/package.json +1 -1
- package/src/components/ui/Photo.js +2 -0
- package/src/utils/InitParameters.js +1 -1
- package/tests/components/ui/Photo.test.js +2 -0
- package/tests/components/ui/__snapshots__/Photo.test.js.snap +5 -0
- package/tests/utils/InitParameters.test.js +6 -0
package/docs/03_URL_settings.md
CHANGED
|
@@ -36,7 +36,7 @@ Choose the allowed navigation between pictures, to eventually restrict what is v
|
|
|
36
36
|
|
|
37
37
|
- `nav=any` (or no value): no restriction in navigation (default)
|
|
38
38
|
- `nav=seq`: can only see pictures in same sequence
|
|
39
|
-
- `nav=none`: can only see current picture, no navigation to other picture allowed
|
|
39
|
+
- `nav=none/pic`: can only see current picture, no navigation to other picture allowed
|
|
40
40
|
|
|
41
41
|
## :material-image: Picture settings
|
|
42
42
|
|
package/package.json
CHANGED
|
@@ -833,6 +833,7 @@ export default class Photo extends PSViewer {
|
|
|
833
833
|
* @memberof Panoramax.components.ui.Photo#
|
|
834
834
|
*/
|
|
835
835
|
setPicturesNavigation(pn) {
|
|
836
|
+
if(pn === "none") { pn = "pic"; }
|
|
836
837
|
this._picturesNavigation = pn;
|
|
837
838
|
|
|
838
839
|
/**
|
|
@@ -856,6 +857,7 @@ export default class Photo extends PSViewer {
|
|
|
856
857
|
case "seq":
|
|
857
858
|
return ["next", "prev"].includes(link.rel);
|
|
858
859
|
case "pic":
|
|
860
|
+
case "none":
|
|
859
861
|
return false;
|
|
860
862
|
case "any":
|
|
861
863
|
default:
|
|
@@ -284,7 +284,7 @@ export function alterPSVState(psv, params) {
|
|
|
284
284
|
}
|
|
285
285
|
|
|
286
286
|
// Change pictures navigation mode
|
|
287
|
-
if(["pic", "any", "seq"].includes(params.picturesNavigation)) {
|
|
287
|
+
if(["none", "pic", "any", "seq"].includes(params.picturesNavigation)) {
|
|
288
288
|
psv.setPicturesNavigation(params.picturesNavigation);
|
|
289
289
|
}
|
|
290
290
|
}
|
|
@@ -362,6 +362,8 @@ describe("setPicturesNavigation", () => {
|
|
|
362
362
|
expect(ph.getPicturesNavigation()).toBe("seq");
|
|
363
363
|
ph.setPicturesNavigation("any");
|
|
364
364
|
expect(ph.getPicturesNavigation()).toBe("any");
|
|
365
|
+
ph.setPicturesNavigation("none");
|
|
366
|
+
expect(ph.getPicturesNavigation()).toBe("pic");
|
|
365
367
|
expect(eventWatcher.mock.calls).toMatchSnapshot();
|
|
366
368
|
});
|
|
367
369
|
});
|
|
@@ -312,6 +312,12 @@ describe("alterPSVState", () => {
|
|
|
312
312
|
expect(psv.setPicturesNavigation).toHaveBeenCalledWith("pic");
|
|
313
313
|
});
|
|
314
314
|
|
|
315
|
+
it("should set pictures navigation mode when picturesNavigation=none", () => {
|
|
316
|
+
const params = { picturesNavigation: "none" };
|
|
317
|
+
alterPSVState(psv, params);
|
|
318
|
+
expect(psv.setPicturesNavigation).toHaveBeenCalledWith("none");
|
|
319
|
+
});
|
|
320
|
+
|
|
315
321
|
it("should not set pictures navigation mode when picturesNavigation param is invalid", () => {
|
|
316
322
|
const params = { picturesNavigation: "invalid" };
|
|
317
323
|
alterPSVState(psv, params);
|