mirror of
https://github.com/flynx/pWiki.git
synced 2025-10-29 10:00:08 +00:00
tweaking....
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
4c9597e27b
commit
69701f0697
@ -74,6 +74,9 @@
|
||||
outline: none;
|
||||
border: none;
|
||||
}
|
||||
.editor.block-offsets .outline .block {
|
||||
border-left: solid 1px silver;
|
||||
}
|
||||
.editor .outline .block .block {
|
||||
margin-left: var(--item-indent);
|
||||
}
|
||||
|
||||
@ -855,13 +855,19 @@ var Outline = {
|
||||
var elem = this.get(...arguments)
|
||||
?? this.get(0)
|
||||
if(elem){
|
||||
var cur = this.get()
|
||||
var blocks = this.get('visible')
|
||||
elem.focus({preventScroll: true})
|
||||
;(elem.classList.contains('code') ?
|
||||
elem
|
||||
: elem.querySelector('.code'))
|
||||
.scrollIntoView({
|
||||
block: 'nearest',
|
||||
//behavior: 'smooth',
|
||||
// smooth for long jumps and instant for short jumps...
|
||||
behavior: (cur == null
|
||||
|| Math.abs(blocks.indexOf(cur) - blocks.indexOf(elem)) > 2) ?
|
||||
'smooth'
|
||||
: 'instant'
|
||||
}) }
|
||||
return elem },
|
||||
edit: function(node='focused', offset){
|
||||
|
||||
@ -342,6 +342,7 @@ var setup = function(){
|
||||
<hr>
|
||||
|
||||
<button onclick="editor.dom.classList.toggle('show-click-zones')">show/hide click zones</button>
|
||||
<button onclick="editor.dom.classList.toggle('block-offsets')">show/hide block offsets</button>
|
||||
|
||||
|
||||
</body>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user