1
- L . U . Importer = L . Class . extend ( {
1
+ U . Importer = L . Class . extend ( {
2
2
initialize : function ( map ) {
3
3
this . map = map
4
4
this . presets = map . options . importPresets
@@ -27,7 +27,7 @@ L.U.Importer = L.Class.extend({
27
27
const noPreset = L . DomUtil . create ( 'option' , '' , element )
28
28
noPreset . value = noPreset . textContent = L . _ ( 'Choose a preset' )
29
29
for ( const preset of this . presets ) {
30
- option = L . DomUtil . create ( 'option' , '' , presetSelect )
30
+ option = L . DomUtil . create ( 'option' , '' , this . presetSelect )
31
31
option . value = preset . url
32
32
option . textContent = preset . label
33
33
}
@@ -39,6 +39,7 @@ L.U.Importer = L.Class.extend({
39
39
this . form = template . content . firstElementChild . cloneNode ( true )
40
40
this . presetSelect = this . form . querySelector ( '[name="preset-select"]' )
41
41
this . fileInput = this . form . querySelector ( '[name="file-input"]' )
42
+ this . map . ui . once ( 'panel:closed' , ( ) => ( this . fileInput . value = null ) )
42
43
this . typeLabel = this . form . querySelector ( '#type-label' )
43
44
const helpButton = this . typeLabel . querySelector ( 'button' )
44
45
this . map . help . button ( this . typeLabel , 'importFormats' , '' , helpButton )
0 commit comments