|
@@ -989,7 +989,7 @@ func GetFullHPathByID(id string) (hPath string, err error) {
|
|
return
|
|
return
|
|
}
|
|
}
|
|
|
|
|
|
-func MoveDocs(fromPaths []string, toBoxID, toPath string) (err error) {
|
|
|
|
|
|
+func MoveDocs(fromPaths []string, toBoxID, toPath string, callback interface{}) (err error) {
|
|
toBox := Conf.Box(toBoxID)
|
|
toBox := Conf.Box(toBoxID)
|
|
if nil == toBox {
|
|
if nil == toBox {
|
|
err = errors.New(Conf.Language(0))
|
|
err = errors.New(Conf.Language(0))
|
|
@@ -1020,7 +1020,7 @@ func MoveDocs(fromPaths []string, toBoxID, toPath string) (err error) {
|
|
WaitForWritingFiles()
|
|
WaitForWritingFiles()
|
|
luteEngine := util.NewLute()
|
|
luteEngine := util.NewLute()
|
|
for fromPath, fromBox := range pathsBoxes {
|
|
for fromPath, fromBox := range pathsBoxes {
|
|
- _, err = moveDoc(fromBox, fromPath, toBox, toPath, luteEngine)
|
|
|
|
|
|
+ _, err = moveDoc(fromBox, fromPath, toBox, toPath, luteEngine, callback)
|
|
if nil != err {
|
|
if nil != err {
|
|
return
|
|
return
|
|
}
|
|
}
|
|
@@ -1036,7 +1036,7 @@ func MoveDocs(fromPaths []string, toBoxID, toPath string) (err error) {
|
|
return
|
|
return
|
|
}
|
|
}
|
|
|
|
|
|
-func moveDoc(fromBox *Box, fromPath string, toBox *Box, toPath string, luteEngine *lute.Lute) (newPath string, err error) {
|
|
|
|
|
|
+func moveDoc(fromBox *Box, fromPath string, toBox *Box, toPath string, luteEngine *lute.Lute, callback interface{}) (newPath string, err error) {
|
|
isSameBox := fromBox.ID == toBox.ID
|
|
isSameBox := fromBox.ID == toBox.ID
|
|
|
|
|
|
if isSameBox {
|
|
if isSameBox {
|
|
@@ -1150,6 +1150,7 @@ func moveDoc(fromBox *Box, fromPath string, toBox *Box, toPath string, luteEngin
|
|
"toPath": toPath,
|
|
"toPath": toPath,
|
|
"newPath": newPath,
|
|
"newPath": newPath,
|
|
}
|
|
}
|
|
|
|
+ evt.Callback = callback
|
|
util.PushEvent(evt)
|
|
util.PushEvent(evt)
|
|
return
|
|
return
|
|
}
|
|
}
|