Quellcode durchsuchen

【大纲】文档第一个大纲是Email/URL大纲,打开文档会默认直接打开邮箱或网页

liujiajie vor 6 Monaten
Ursprung
Commit
d66c25459d

+ 4 - 1
PDF Office/PDF Master/Class/PDFWindowController/Side/LeftSide/KMLeftSideViewController+Outline.swift

@@ -406,9 +406,12 @@ extension KMLeftSideViewController {
             if let dest = ol.destination {
                 self.listView?.go(to: dest)
             } else if let act = ol.action {
-                self.listView?.perform(act)
+                if !self.isFirst {
+                    self.listView?.perform(act)
+                }
             }
         }
+        self.isFirst = false
     }
     
     public func refreshUIOfOutlineIfNeed() {

+ 2 - 0
PDF Office/PDF Master/Class/PDFWindowController/Side/LeftSide/KMLeftSideViewController.swift

@@ -98,6 +98,8 @@ class KMLeftSideViewController: KMSideViewController {
     static let kFudgeSize: Float                = 0.1
     static let kOutlineRootBookmarkItem = "Bookmarks"
     
+    var isFirst = false  //打开阅读页初始化
+    
     var type : KMLeftMethodMode = KMLeftMethodMode()
     var isShowPanel : Bool = false
     weak var delegate: KMLeftSideViewControllerDelegate?

+ 1 - 1
PDF Office/PDF Master/Class/PDFWindowController/ViewController/KMMainViewController.swift

@@ -479,7 +479,7 @@ import Cocoa
         var frame = self.leftView.frame
         frame.size.width += 44
         self.leftView.frame = frame
-        
+        leftSideViewController.isFirst = true
         leftSideViewController.listView = self.listView ?? CPDFListView()
         leftSideViewController.view.frame = CGRect(x: 0, y:0 , width: self.leftView.frame.size.width, height: self.leftView.frame.size.height)
         leftSideViewController.view.autoresizingMask = [.height,.width]