Skip to content

Commit

Permalink
♻ refactor: val => const (#728)
Browse files Browse the repository at this point in the history
* feat: Global navigation waterfall layout

* style:Remove duplicate styles

* ♻ refactor: Automatically update Masonry layout

* style: Remove Comment

* ♻ refactor:  val => const

* ♻ refactor: InitMasonryAsync => InitOrUpdateMasonryAsync
  • Loading branch information
wzh425 authored Aug 13, 2024
1 parent 4092306 commit 9afba13
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ protected override async Task OnAfterRenderAsync(bool firstRender)
if (_shouldUpdateMasonry)
{
_shouldUpdateMasonry = false;
await InitMasonryAsync();
await InitOrUpdateMasonryAsync();
}
}

Expand All @@ -41,7 +41,7 @@ protected override async Task OnParametersSetAsync()
await base.OnParametersSetAsync();
}

protected virtual async Task InitMasonryAsync()
protected virtual async Task InitOrUpdateMasonryAsync()
{
if (Value is not null)
{
Expand Down
2 changes: 1 addition & 1 deletion src/Masa.Stack.Components/wwwroot/js/components.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ window.MasaStackComponents.getTimezoneOffset = function() {
let masonryInstances = {};

window.MasaStackComponents.initOrUpdateMasonry = (selector, itemSelector, gutter) => {
var elem = document.querySelector(selector);
const elem = document.querySelector(selector);
if (!elem) return;

if (masonryInstances[selector]) {
Expand Down

0 comments on commit 9afba13

Please sign in to comment.