Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitb4df6e4

Browse files
authored
Merge pull request#32 from github/update-check-for-position
Update logic for determining list position
2 parents83d8a71 +175ca23 commitb4df6e4

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

‎src/task-lists-element.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,21 +175,27 @@ function syncDisabled(list: TaskListsElement) {
175175
}
176176
}
177177

178+
functionqueryLists(container:Element){
179+
returnArray.from(container.querySelectorAll('ol, ul')).filter(list=>{
180+
return!list.closest('tracking-block')
181+
})
182+
}
183+
178184
// Given a top-level task list, return its index location in the container. All
179185
// lists in the container, not just task lists, are indexed to match the
180186
// server-side Markdown parser's indexing.
181187
functionlistIndex(list:Element):number{
182188
constcontainer=list.closest('task-lists')
183189
if(!container)thrownewError('parent not found')
184-
returnArray.from(container.querySelectorAll('ol, ul')).indexOf(list)
190+
returnqueryLists(container).indexOf(list)
185191
}
186192

187193
constoriginalLists=newWeakMap()
188194

189195
functiononSortStart(srcList:Element){
190196
constcontainer=srcList.closest('task-lists')
191197
if(!container)thrownewError('parent not found')
192-
originalLists.set(container,Array.from(container.querySelectorAll('ol, ul')))
198+
originalLists.set(container,queryLists(container))
193199
}
194200

195201
functiononSorted({src, dst}:SortEndArgs){

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp