mirror of
https://github.com/oqtane/oqtane.framework.git
synced 2025-05-17 18:14:22 +00:00
Merge pull request #2845 from sbwalker/dev
add module base class method for ScrollToTop
This commit is contained in:
commit
549d71073e
@ -624,7 +624,8 @@
|
||||
else
|
||||
{
|
||||
AddModuleMessage(Localizer["Success.Settings.SaveSite"], MessageType.Success);
|
||||
await interop.ScrollTo(0, 0, "smooth");
|
||||
// scroll to top of page so user can see messages
|
||||
await ScrollToTop();
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -693,8 +694,9 @@
|
||||
|
||||
await NotificationService.AddNotificationAsync(new Notification(PageState.Site.SiteId, PageState.User, PageState.Site.Name + " SMTP Configuration Test", "SMTP Server Is Configured Correctly."));
|
||||
AddModuleMessage(Localizer["Info.Smtp.SaveSettings"], MessageType.Info);
|
||||
var interop = new Interop(JSRuntime);
|
||||
await interop.ScrollTo(0, 0, "smooth");
|
||||
|
||||
// scroll to top of page so user can see messages
|
||||
await ScrollToTop();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
@ -356,9 +356,6 @@ else
|
||||
|
||||
AddModuleMessage(Localizer["Success.Profile.Update"], MessageType.Success);
|
||||
StateHasChanged();
|
||||
|
||||
var interop = new Interop(JSRuntime);
|
||||
await interop.ScrollTo(0, 0, "smooth");
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -374,6 +371,9 @@ else
|
||||
{
|
||||
AddModuleMessage(Localizer["Message.Required.ProfileInfo"], MessageType.Warning);
|
||||
}
|
||||
|
||||
// scroll to top of page so user can see messages
|
||||
await ScrollToTop();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
@ -291,6 +291,12 @@ namespace Oqtane.Modules
|
||||
}
|
||||
}
|
||||
|
||||
public async Task ScrollToTop()
|
||||
{
|
||||
var interop = new Interop(JSRuntime);
|
||||
await interop.ScrollTo(0, 0, "smooth");
|
||||
}
|
||||
|
||||
// logging methods
|
||||
public async Task Log(Alias alias, LogLevel level, string function, Exception exception, string message, params object[] args)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user