mirror of
https://github.com/flynx/pWiki.git
synced 2025-10-29 10:00:08 +00:00
fix...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
9e8557ebc3
commit
44a542e816
@ -1043,6 +1043,7 @@ var Outline = {
|
||||
var cur = this.get(node)
|
||||
if(!cur){
|
||||
return }
|
||||
var prev = this.path(cur)
|
||||
var siblings = this.get(node, 'siblings')
|
||||
// deindent...
|
||||
if(indent == 'out'){
|
||||
@ -1056,7 +1057,8 @@ var Outline = {
|
||||
this.setUndo(
|
||||
this.path(cur),
|
||||
'indent',
|
||||
['in'])
|
||||
['in'],
|
||||
prev)
|
||||
this.__change__() }
|
||||
// indent...
|
||||
} else {
|
||||
@ -1066,7 +1068,8 @@ var Outline = {
|
||||
this.setUndo(
|
||||
this.path(cur),
|
||||
'indent',
|
||||
['out'])
|
||||
['out'],
|
||||
prev)
|
||||
this.__change__()} }
|
||||
return cur },
|
||||
shift: function(node='focused', direction){
|
||||
@ -1084,13 +1087,11 @@ var Outline = {
|
||||
if(direction == 'up'
|
||||
&& i > 0){
|
||||
siblings[i-1].before(node)
|
||||
focused
|
||||
&& this.focus()
|
||||
} else if(direction == 'down'
|
||||
&& i < siblings.length-1){
|
||||
siblings[i+1].after(node)
|
||||
siblings[i+1].after(node) }
|
||||
focused
|
||||
&& this.focus() }
|
||||
&& this.focus()
|
||||
this.setUndo(
|
||||
this.path(node),
|
||||
'shift',
|
||||
@ -1211,8 +1212,8 @@ var Outline = {
|
||||
// are reassigning the stacks manually.
|
||||
__undo_stack: undefined,
|
||||
__redo_stack: undefined,
|
||||
setUndo: function(path, action, args){
|
||||
;(this.__undo_stack ??= []).push([path, action, args])
|
||||
setUndo: function(path, action, args, next){
|
||||
;(this.__undo_stack ??= []).push([path, action, args, next])
|
||||
this.__redo_stack = undefined
|
||||
return this },
|
||||
clearUndo: function(){
|
||||
@ -1223,11 +1224,14 @@ var Outline = {
|
||||
if(from == null
|
||||
|| from.length == 0){
|
||||
return [from, to] }
|
||||
var [path, action, args] = from.pop()
|
||||
var [path, action, args, next] = from.pop()
|
||||
var l = from.length
|
||||
path != null
|
||||
&& this.focus(path)
|
||||
this[action](...args)
|
||||
next != null ?
|
||||
this.focus(next)
|
||||
: this.focus()
|
||||
if(l < from.length){
|
||||
to ??= []
|
||||
to.push(
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user