This commit is contained in:
parent
045cf17dee
commit
10d6d7521a
|
@ -107,6 +107,7 @@ function showSearchResults(searchTool, query, input, value, resultType) {
|
||||||
|
|
||||||
function showSearchResultsExtended(element, template, searchTool, query, input, value, resultType, options) {
|
function showSearchResultsExtended(element, template, searchTool, query, input, value, resultType, options) {
|
||||||
const $lc = $(element)
|
const $lc = $(element)
|
||||||
|
// FIXME(peter): we should not reload this every time we search
|
||||||
return searchTool(query).then(results => {
|
return searchTool(query).then(results => {
|
||||||
let opt = options || {};
|
let opt = options || {};
|
||||||
if (opt.showOnlyResults && (query.length === 0 || !results.length)) {
|
if (opt.showOnlyResults && (query.length === 0 || !results.length)) {
|
||||||
|
|
|
@ -137,9 +137,10 @@ function editor(root, inputData, options) {
|
||||||
startEditing(root, store, cursor)
|
startEditing(root, store, cursor)
|
||||||
}
|
}
|
||||||
|
|
||||||
function getChildren(id ) {
|
function getChildren(id) {
|
||||||
return store.children(id )
|
return store.children(id)
|
||||||
}
|
}
|
||||||
|
|
||||||
function replaceChildren(id, children) {
|
function replaceChildren(id, children) {
|
||||||
store.replaceChildren(id, children)
|
store.replaceChildren(id, children)
|
||||||
}
|
}
|
||||||
|
|
|
@ -293,7 +293,7 @@ function Store(inputData) {
|
||||||
let fromIndex = index(from)
|
let fromIndex = index(from)
|
||||||
let toIndex = to && to !== 'at-end' ? index(to) : idList.length
|
let toIndex = to && to !== 'at-end' ? index(to) : idList.length
|
||||||
let n = lastHigherIndented(fromIndex) - fromIndex
|
let n = lastHigherIndented(fromIndex) - fromIndex
|
||||||
if (toIndex >= fromIndex && toIndex < fromIndex + n) return index(from)
|
if (toIndex >= fromIndex && toIndex < fromIndex + n) return [index(from), n]
|
||||||
if (fromIndex < toIndex) {
|
if (fromIndex < toIndex) {
|
||||||
rotate(idList, fromIndex, toIndex, n)
|
rotate(idList, fromIndex, toIndex, n)
|
||||||
changed = true
|
changed = true
|
||||||
|
|
Loading…
Reference in New Issue
Block a user