Skip to content

Commit 9d38484

Browse files
authored
GoogleMap component code cleanup (#847)
1 parent 4061db0 commit 9d38484

File tree

3 files changed

+16
-4
lines changed

3 files changed

+16
-4
lines changed

blazorbootstrap/Components/Maps/GoogleMap.razor

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@
88
Source="@GoogleMapsJsFileUrl"
99
OnLoad="OnScriptLoad" />
1010

11-
<div @ref="@Element" id="@Id" class="@ClassNames" style="@StyleNames" role="alert" @attributes="@AdditionalAttributes">
11+
<div @ref="@Element" id="@Id" class="@ClassNames" style="@StyleNames" @attributes="@AdditionalAttributes">
1212
</div>

blazorbootstrap/Components/ScriptLoader/ScriptLoader.razor.cs

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ public partial class ScriptLoader : BlazorBootstrapComponentBase
1010
/// <summary>
1111
/// The default content type for scripts.
1212
/// </summary>
13-
private const string type = "text/javascript";
13+
private const string ScriptType = "text/javascript";
1414

1515
/// <summary>
1616
/// A reference to this component instance for use in JavaScript calls.
@@ -24,7 +24,7 @@ public partial class ScriptLoader : BlazorBootstrapComponentBase
2424
protected override async Task OnAfterRenderAsync(bool firstRender)
2525
{
2626
if (firstRender)
27-
await JSRuntime.InvokeVoidAsync("window.blazorBootstrap.scriptLoader.initialize", Id, Async, Defer, ScriptId, Source, type, objRef);
27+
await JSRuntime.InvokeVoidAsync("window.blazorBootstrap.scriptLoader.initialize", Id, Async, Defer, ScriptId, Source, ScriptType, objRef);
2828

2929
await base.OnAfterRenderAsync(firstRender);
3030
}
@@ -72,13 +72,19 @@ public void OnLoadJS()
7272
/// <summary>
7373
/// Gets or sets a value indicating whether the script should be loaded asynchronously.
7474
/// </summary>
75+
/// <remarks>
76+
/// Default value is <see langword="false" />.
77+
/// </remarks>
7578
[Parameter]
7679
public bool Async { get; set; }
7780

7881
/// <summary>
7982
/// Gets or sets a value indicating whether the script is meant to be executed
8083
/// after the document has been parsed, but before firing DOMContentLoaded event..
8184
/// </summary>
85+
/// <remarks>
86+
/// Default value is <see langword="false" />.
87+
/// </remarks>
8288
[Parameter]
8389
public bool Defer { get; set; }
8490

@@ -97,12 +103,18 @@ public void OnLoadJS()
97103
/// <summary>
98104
/// Gets or sets the ID of the script element.
99105
/// </summary>
106+
/// <remarks>
107+
/// Default value is <see langword="null" />.
108+
/// </remarks>
100109
[Parameter]
101110
public string? ScriptId { get; set; }
102111

103112
/// <summary>
104113
/// Gets or sets the URI of the external script to load.
105114
/// </summary>
115+
/// <remarks>
116+
/// Default value is <see langword="null" />.
117+
/// </remarks>
106118
[Parameter]
107119
[EditorRequired]
108120
public string? Source { get; set; } = default!;

blazorbootstrap/wwwroot/blazor.bootstrap.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -462,7 +462,7 @@ window.blazorBootstrap = {
462462
return window.blazorBootstrap.googlemaps.instances[elementId];
463463
},
464464
initialize: (elementId, zoom, center, markers, clickable, dotNetHelper) => {
465-
window.blazorBootstrap.googlemaps.markerEls[elementId] = window.blazorBootstrap.googlemaps.markerEls[elementId] ?? []
465+
window.blazorBootstrap.googlemaps.markerEls[elementId] = window.blazorBootstrap.googlemaps.markerEls[elementId] ?? [];
466466

467467
let mapOptions = { center: center, zoom: zoom, mapId: elementId };
468468
let map = new google.maps.Map(document.getElementById(elementId), mapOptions);

0 commit comments

Comments
 (0)