mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-22 01:20:12 +01:00
🎨 Database block support specified view https://github.com/siyuan-note/siyuan/issues/10443
This commit is contained in:
parent
3ce6e4824b
commit
cb726e0118
7 changed files with 62 additions and 43 deletions
|
|
@ -376,14 +376,26 @@ func (av *AttributeView) GetView(viewID string) (ret *View) {
|
|||
return
|
||||
}
|
||||
|
||||
func (av *AttributeView) GetCurrentView() (ret *View, err error) {
|
||||
func (av *AttributeView) GetCurrentView(viewID string) (ret *View, err error) {
|
||||
if "" != viewID {
|
||||
ret = av.GetView(viewID)
|
||||
if nil != ret {
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
for _, v := range av.Views {
|
||||
if v.ID == av.ViewID {
|
||||
ret = v
|
||||
return
|
||||
}
|
||||
}
|
||||
err = ErrViewNotFound
|
||||
|
||||
if 1 > len(av.Views) {
|
||||
err = ErrViewNotFound
|
||||
return
|
||||
}
|
||||
ret = av.Views[0]
|
||||
return
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue