Skip to content

Commit e4867b3

Browse files
committed
Merge branch 'doc-ob' into nhren
2 parents 7f2242c + a77773b commit e4867b3

File tree

3 files changed

+21
-19
lines changed

3 files changed

+21
-19
lines changed

src/BootstrapBlazor.Server/Components/Samples/IntersectionObservers.razor

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,20 @@
22
@inject IStringLocalizer<IntersectionObservers> Localizer
33
@inject IOptionsMonitor<WebsiteOptions> WebsiteOption
44

5+
<HeadContent>
6+
<style>
7+
.bb-video video {
8+
width: 256px;
9+
}
10+
11+
@@media (min-width: 767.99px) {
12+
.bb-video video {
13+
width: 350px;
14+
}
15+
}
16+
</style>
17+
</HeadContent>
18+
519
<h3>@Localizer["IntersectionObserverTitle"]</h3>
620

721
<h4>@Localizer["IntersectionObserverDescription"]</h4>
@@ -56,23 +70,10 @@
5670
<DemoBlock Title="@Localizer["IntersectionObserverVisibleTitle"]"
5771
Introduction="@Localizer["IntersectionObserverVisibleIntro"]"
5872
Name="Visible">
59-
<HeadContent>
60-
<style>
61-
.bb-video video {
62-
width: 256px;
63-
}
64-
65-
@@media (min-width: 767.99px) {
66-
.bb-video video {
67-
width: 350px;
68-
}
69-
}
70-
</style>
71-
</HeadContent>
7273
<section ignore>
7374
<p>@((MarkupString)Localizer["IntersectionObserverVisibleDesc"].Value)</p>
75+
<div class="text-center @_textColorString">@_videoStateString</div>
7476
</section>
75-
<p class="text-center @_textColorString">@_videoStateString</p>
7677
<IntersectionObserver OnIntersecting="OnVisibleChanged" Threshold="1" AutoUnobserveWhenIntersection="false">
7778
<div class="bb-video-demo scroll">
7879
<div class="bb-video">
@@ -87,8 +88,10 @@
8788
<DemoBlock Title="@Localizer["IntersectionObserverThresholdTitle"]"
8889
Introduction="@Localizer["IntersectionObserverThresholdIntro"]"
8990
Name="Threshold">
90-
<section ignore><p>@((MarkupString)Localizer["IntersectionObserverThresholdDesc"].Value)</p></section>
91-
<p class="text-center">@_thresholdValueString</p>
91+
<section ignore>
92+
<p>@((MarkupString)Localizer["IntersectionObserverThresholdDesc"].Value)</p>
93+
<div class="text-center">@_thresholdValueString</div>
94+
</section>
9295
<IntersectionObserver OnIntersecting="OnThresholdChanged" Threshold="0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1" AutoUnobserveWhenIntersection="false">
9396
<div class="bb-list-load scroll" style="height: 200px;">
9497
<div class="d-flex" style="height: 600px; justify-content: center; align-items: center;">

src/BootstrapBlazor/Components/IntersectionObserver/IntersectionObserver.razor.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
// See the LICENSE file in the project root for more information.
44
// Maintainer: Argo Zhang([email protected]) Website: https://www.blazor.zone
55

6-
76
namespace BootstrapBlazor.Components;
87

98
/// <summary>
@@ -12,7 +11,7 @@ namespace BootstrapBlazor.Components;
1211
public partial class IntersectionObserver
1312
{
1413
/// <summary>
15-
/// The element that is used as the viewport for checking visibility of the target. Must be the ancestor of the target. Defaults to the browser viewport if not specified or if null
14+
/// The element that is used as the viewport for checking visibility of the target. Must be the ancestor of the target. Defaults to the browser viewport if value is false. Default value is false
1615
/// </summary>
1716
[Parameter]
1817
public bool UseElementViewport { get; set; }

src/BootstrapBlazor/Components/IntersectionObserver/IntersectionObserver.razor.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export function init(id, invoke, options) {
88

99
const items = [...el.querySelectorAll(".bb-intersection-observer-item")];
1010

11-
if (options.useElementViewport === false) {
11+
if (options.useElementViewport === true) {
1212
options.root = el;
1313
}
1414
if (options.threshold && options.threshold.indexOf(' ') > 0) {

0 commit comments

Comments
 (0)