From fdf5e521d859175a5f0dccc19f5c7fee99a6724f Mon Sep 17 00:00:00 2001 From: James Lyne Date: Tue, 31 Aug 2021 16:38:19 +0100 Subject: [PATCH] Prefer using super over prototype calls --- src/leaflet/control/LiveAtlasLayerControl.ts | 7 +++---- src/leaflet/icon/GenericIcon.ts | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/leaflet/control/LiveAtlasLayerControl.ts b/src/leaflet/control/LiveAtlasLayerControl.ts index 009ead5..8245c4b 100644 --- a/src/leaflet/control/LiveAtlasLayerControl.ts +++ b/src/leaflet/control/LiveAtlasLayerControl.ts @@ -27,7 +27,6 @@ import {nextTick, watch} from "vue"; import {handleKeyboardEvent} from "@/util/events"; import LayersObject = Control.LayersObject; import LayersOptions = Control.LayersOptions; -import Layers = Control.Layers; const store = useStore(); @@ -199,7 +198,7 @@ export class LiveAtlasLayerControl extends Control.Layers { input.defaultChecked = checked; } else { // @ts-ignore - input = Layers.prototype._createRadioElement.call(this, 'leaflet-base-layers_' + Util.stamp(this), checked); + input = super._createRadioElement('leaflet-base-layers_' + Util.stamp(this), checked); } input.layerId = Util.stamp(obj.layer); @@ -207,7 +206,7 @@ export class LiveAtlasLayerControl extends Control.Layers { label.textContent = obj.name; // @ts-ignore - DomEvent.on(input, 'click', (e: LeafletEvent) => Layers.prototype._onInputClick.call(this, e), this); + DomEvent.on(input, 'click', (e: LeafletEvent) => super._onInputClick(e), this); item.appendChild(input); item.insertAdjacentHTML('beforeend', ` @@ -219,7 +218,7 @@ export class LiveAtlasLayerControl extends Control.Layers { container!.appendChild(item); // @ts-ignore - Layers.prototype._checkDisabledLayers.call(this); + super._checkDisabledLayers(); return label; } diff --git a/src/leaflet/icon/GenericIcon.ts b/src/leaflet/icon/GenericIcon.ts index 3de9624..3f5bbb4 100644 --- a/src/leaflet/icon/GenericIcon.ts +++ b/src/leaflet/icon/GenericIcon.ts @@ -75,7 +75,7 @@ export class GenericIcon extends DivIcon { this._image.src = url; // @ts-ignore - Icon.prototype._setIconStyles.call(this, div, 'icon'); + super._setIconStyles.call(div, 'icon'); div.appendChild(this._image); div.classList.add('marker');