|
@@ -29,6 +29,11 @@ import KMComponentLibrary
|
|
|
- 输入文字:修改跳转内容。
|
|
|
*/
|
|
|
|
|
|
+@objc protocol KMLinkViewControllerDelegate: AnyObject {
|
|
|
+
|
|
|
+ @objc optional func kmLinkViewControllerDidUpdateMode(_ controller: KMLinkViewController)
|
|
|
+}
|
|
|
+
|
|
|
//MARK: - KMLinkViewController
|
|
|
@objcMembers class KMLinkViewController: NSViewController {
|
|
|
|
|
@@ -56,6 +61,8 @@ import KMComponentLibrary
|
|
|
let webProperty = ComponentTabsProperty(tabsType: .underline_Fill, state: .normal, showIcon: false, title: NSLocalizedString("Web", comment: ""))
|
|
|
let emailProperty = ComponentTabsProperty(tabsType: .underline_Fill, state: .normal, showIcon: false, title: NSLocalizedString("Email", comment: ""))
|
|
|
|
|
|
+ weak open var delegate: KMLinkViewControllerDelegate?
|
|
|
+
|
|
|
public override func viewDidLoad() {
|
|
|
super.viewDidLoad()
|
|
|
// Do view setup here.
|
|
@@ -122,18 +129,26 @@ import KMComponentLibrary
|
|
|
}
|
|
|
}
|
|
|
annotations = linkAnnotations
|
|
|
- current_Annotation = nil
|
|
|
|
|
|
if annotations.count == 0 {
|
|
|
emptyContendView.isHidden = false
|
|
|
|
|
|
+ current_Annotation = nil
|
|
|
+ linkPageView.clearData()
|
|
|
linkWebView.clearData()
|
|
|
-
|
|
|
linkEmailView.clearData()
|
|
|
|
|
|
} else if annotations.count == 1 {
|
|
|
|
|
|
- current_Annotation = annotations.first
|
|
|
+ if let annotation = annotations.first {
|
|
|
+ if current_Annotation != annotation {
|
|
|
+ current_Annotation = annotation
|
|
|
+
|
|
|
+ linkPageView.clearData()
|
|
|
+ linkWebView.clearData()
|
|
|
+ linkEmailView.clearData()
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
multiController.view.isHidden = true
|
|
|
typeContendView.isHidden = false
|
|
@@ -258,6 +273,9 @@ extension KMLinkViewController: ComponentTabsDelegate {
|
|
|
|
|
|
}
|
|
|
CPDFLinkAnnotation.updateDefault_AddLinkType(pdfLinkType.rawValue)
|
|
|
+
|
|
|
+ delegate?.kmLinkViewControllerDidUpdateMode?(self)
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
|