[frontend/components] Remove redundant scroller from SingleNote view
This commit is contained in:
parent
fa213b47a7
commit
14b9a2cef0
3 changed files with 12 additions and 17 deletions
|
@ -242,7 +242,7 @@
|
||||||
|
|
||||||
if (state != null)
|
if (state != null)
|
||||||
{
|
{
|
||||||
Module.InvokeVoid("SetScrollTop", Scroller, state.ScrollTop);
|
Module.InvokeVoid("SetScrollY", state.ScrollTop);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -255,14 +255,14 @@
|
||||||
{
|
{
|
||||||
if (NoteId == null || _componentState != State.Loaded) return;
|
if (NoteId == null || _componentState != State.Loaded) return;
|
||||||
var scrollTop = (Module ?? throw new Exception("JS Interop used before init"))
|
var scrollTop = (Module ?? throw new Exception("JS Interop used before init"))
|
||||||
.Invoke<float>("GetScrollTop", Scroller);
|
.Invoke<float>("GetScrollY");
|
||||||
var state = new SingleNoteState { ScrollTop = scrollTop };
|
var state = new SingleNoteState { ScrollTop = scrollTop };
|
||||||
StateSvc.SingleNote.SetState(NoteId, state);
|
StateSvc.SingleNote.SetState(NoteId, state);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Dispose()
|
public void Dispose()
|
||||||
{
|
{
|
||||||
if (_noteChangedHandler != null) _noteChangedHandler.Dispose();
|
_noteChangedHandler?.Dispose();
|
||||||
SaveState();
|
SaveState();
|
||||||
_locationChangingHandlerDisposable?.Dispose();
|
_locationChangingHandlerDisposable?.Dispose();
|
||||||
MessageService.AnyNoteDeleted -= OnNoteDeleted;
|
MessageService.AnyNoteDeleted -= OnNoteDeleted;
|
||||||
|
|
|
@ -6,11 +6,6 @@
|
||||||
border-bottom: solid var(--highlight-color) 0.1rem;
|
border-bottom: solid var(--highlight-color) 0.1rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.scroller {
|
|
||||||
overflow-y: auto;
|
|
||||||
overflow-x: clip;
|
|
||||||
}
|
|
||||||
|
|
||||||
.descendants {
|
.descendants {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
export function GetScrollTop(ref) {
|
|
||||||
return ref.scrollTop;
|
|
||||||
}
|
|
||||||
|
|
||||||
export function SetScrollTop(ref, number) {
|
|
||||||
ref.scrollTop = number;
|
|
||||||
}
|
|
||||||
|
|
||||||
export function ScrollIntoView(ref) {
|
export function ScrollIntoView(ref) {
|
||||||
ref.scrollIntoView({ behavior: "instant", block: "center"})
|
ref.scrollIntoView({ behavior: "instant", block: "center"})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function GetScrollY(){
|
||||||
|
return window.scrollY;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function SetScrollY(number){
|
||||||
|
window.scroll(window.scrollX, number);
|
||||||
|
}
|
Loading…
Add table
Reference in a new issue