@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.
@@ -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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@panoramax/web-viewer",
3
- "version": "3.2.3-develop-367cb599",
3
+ "version": "3.2.3-develop-00ee44cd",
4
4
  "description": "Panoramax web viewer for geolocated pictures",
5
5
  "main": "build/index.js",
6
6
  "author": "Panoramax team",
@@ -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
  });
@@ -246,6 +246,11 @@ Array [
246
246
  "value": "any",
247
247
  },
248
248
  ],
249
+ Array [
250
+ Object {
251
+ "value": "pic",
252
+ },
253
+ ],
249
254
  ]
250
255
  `;
251
256
 
@@ -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);