Compare commits

..

No commits in common. "e4539b520cc565b8206be56d8b5c42427ebc9911" and "c30156dd103c4d7c001ecc8f93e077232aa12ec7" have entirely different histories.

2 changed files with 15 additions and 38 deletions

View File

@ -79,6 +79,10 @@ body {
display: none;
}
.list-item .fold {
visibility: hidden;
}
.list-item:hover .fold {
visibility: visible;
}
@ -92,17 +96,11 @@ body {
}
.list-item .fold {
height: 24px;
width: 24px;
text-align: center;
align-self: flex-start;
flex-shrink: 0;
font-size: 10px;
margin-top: 4px;
margin-right: 3px;
cursor: pointer;
visibility: hidden;
display: inline-block;
padding-top: 4px;
}
// enable to close multi line content
@ -340,7 +338,6 @@ mark {
.footer {
padding: 0 12px;
margin-top: 300px;
}
.wiki-list-editor {

View File

@ -523,42 +523,22 @@ function editor(root, inputData, options) {
trigger('change')
return false
} catch (e) {
let inputString = pastedData.toString()
if (inputString.match(/^- /)) {
let item = $(this).parents('.list-item')
let id = item.attr('data-id')
let lines = inputString.split(/( *)- /)
lines.shift()
let items = pastedData.toString().split(/\n+/);
let item = $(this).parents('.list-item')
let id = item.attr('data-id')
if (items.length === 1) {
return true
} else {
const firstItem = store.value(id)
const firstIndent = firstItem.indented
let items = _.map(_.chunk(lines, 2), line => {
const indent = Math.trunc(line[0].length / 4);
const item = newListItem(firstItem.indented+indent)
item.text = _.trimEnd(line[1]).replace(/\n/g, " \n")
items = _.map(items, text => {
const item = newListItem(firstItem.indented)
item.text = text
return item
})
store.insertAfter(id, ...items)
trigger('change')
return false
} else {
let items = inputString.split(/\n+/);
let item = $(this).parents('.list-item')
let id = item.attr('data-id')
if (items.length === 1) {
return true
} else {
const firstItem = store.value(id)
items = _.map(items, text => {
const item = newListItem(firstItem.indented)
item.text = text
return item
})
store.insertAfter(id, ...items)
trigger('change')
}
return false
}
return false
}
});