|
@@ -2189,7 +2189,11 @@ extension KMLeftSideViewController: NSOutlineViewDelegate, NSOutlineViewDataSour
|
|
|
self.view.window?.makeFirstResponder(cell?.inputTextF)
|
|
|
}
|
|
|
} else {
|
|
|
- cell?.inputTextF.stringValue = ""
|
|
|
+ if let cont = data.inputContent {
|
|
|
+ cell?.inputTextF.stringValue = cont
|
|
|
+ } else {
|
|
|
+ cell?.inputTextF.stringValue = ""
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
cell?.updateUI(expand: data.isExpand, animated: data.animated)
|
|
@@ -2202,6 +2206,10 @@ extension KMLeftSideViewController: NSOutlineViewDelegate, NSOutlineViewDataSour
|
|
|
data.isFirstResp = false
|
|
|
}
|
|
|
|
|
|
+ cell?.inputDidChanged = { value, _ in
|
|
|
+ data.inputContent = value as? String ?? ""
|
|
|
+ }
|
|
|
+
|
|
|
cell?.itemClick = { [weak self] idx, param in
|
|
|
if idx == 1 { // comment
|
|
|
data.isExpand = !data.isExpand
|
|
@@ -2232,6 +2240,7 @@ extension KMLeftSideViewController: NSOutlineViewDelegate, NSOutlineViewDataSour
|
|
|
|
|
|
// 置空编辑状态
|
|
|
data.replyModel = nil
|
|
|
+ data.inputContent = nil
|
|
|
return
|
|
|
}
|
|
|
if let replyAnno = self?.noteReplyHanddler.createReplyAnnotation(data.anno, content: content, userName: KMPreference.shared.author) {
|
|
@@ -2241,6 +2250,7 @@ extension KMLeftSideViewController: NSOutlineViewDelegate, NSOutlineViewDataSour
|
|
|
model.replyAnno = replyAnno
|
|
|
model.annoModel = data.annoModel
|
|
|
data.annoModel?.replyAnnos.append(model)
|
|
|
+ data.inputContent = nil
|
|
|
self?.noteOutlineView.reloadData()
|
|
|
// if let row = self?.noteOutlineView.row(forItem: data) {
|
|
|
// self?.noteOutlineView.scrollRowToVisible(row)
|
|
@@ -2254,6 +2264,7 @@ extension KMLeftSideViewController: NSOutlineViewDelegate, NSOutlineViewDataSour
|
|
|
} else if idx == 4 { // cancel
|
|
|
data.isExpand = false
|
|
|
data.replyModel = nil
|
|
|
+ data.inputContent = nil
|
|
|
self?.noteOutlineView.reloadItem(data)
|
|
|
}
|
|
|
}
|