@panoramax/web-viewer 3.2.3-develop-a4cbf815 → 3.2.3-develop-d245268c

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@panoramax/web-viewer",
3
- "version": "3.2.3-develop-a4cbf815",
3
+ "version": "3.2.3-develop-d245268c",
4
4
  "description": "Panoramax web viewer for geolocated pictures",
5
5
  "main": "build/index.js",
6
6
  "author": "Panoramax team",
@@ -262,18 +262,17 @@ export default class MapFilters extends LitElement {
262
262
  this._onFormChange();
263
263
  }
264
264
 
265
- /**
266
- * Shortcut button click: change associated input value
267
- * @private
268
- */
269
- _onShortcutClick(field, value) {
270
- return () => {
271
- const elem = this.shadowRoot.getElementById(field);
272
- if(elem) {
273
- if(elem.value !== value) { elem.value = value; }
274
- else { elem.value = ""; }
275
- }
276
- };
265
+ /** @private */
266
+ _onDateShortcut(date) {
267
+ const dateFromField = this.shadowRoot.getElementById("pnx-filter-date-from");
268
+ const dateToField = this.shadowRoot.getElementById("pnx-filter-date-end");
269
+
270
+ if(dateFromField) {
271
+ if(dateFromField.value !== date) { dateFromField.value = date; }
272
+ else { dateFromField.value = ""; }
273
+ }
274
+
275
+ if(dateToField) { dateToField.value = ""; }
277
276
  }
278
277
 
279
278
  /** @private */
@@ -290,13 +289,13 @@ export default class MapFilters extends LitElement {
290
289
  <h4>${fa(faCalendar)} ${this._parent?._t.pnx.filter_date}</h4>
291
290
  <div class="pnx-input-shortcuts">
292
291
  <button
293
- @click=${this._onShortcutClick("pnx-filter-date-from", new Date(new Date().setMonth(new Date().getMonth() - 1)).toISOString().split("T")[0])}
292
+ @click=${() => this._onDateShortcut(new Date(new Date().setMonth(new Date().getMonth() - 1)).toISOString().split("T")[0])}
294
293
  >${this._parent?._t.pnx.filter_date_1month}</button>
295
294
  <button
296
- @click=${this._onShortcutClick("pnx-filter-date-from", new Date(new Date().setMonth(new Date().getMonth() - 6)).toISOString().split("T")[0])}
295
+ @click=${() => this._onDateShortcut(new Date(new Date().setMonth(new Date().getMonth() - 6)).toISOString().split("T")[0])}
297
296
  >${this._parent?._t.pnx.filter_date_6months}</button>
298
297
  <button
299
- @click=${this._onShortcutClick("pnx-filter-date-from", new Date(new Date().setFullYear(new Date().getFullYear() - 1)).toISOString().split("T")[0])}
298
+ @click=${() => this._onDateShortcut(new Date(new Date().setFullYear(new Date().getFullYear() - 1)).toISOString().split("T")[0])}
300
299
  >${this._parent?._t.pnx.filter_date_1year}</button>
301
300
  </div>
302
301
  <div class="pnx-input-group">