|
@@ -547,16 +547,7 @@ class KMBatchOperateAddHeaderFooterViewController: KMBatchOperateBaseViewControl
|
|
|
reloadTable()
|
|
|
postNotification()
|
|
|
}
|
|
|
- func validateMenuItem(_ menuItem: NSMenuItem) -> Bool {
|
|
|
- let action = menuItem.action
|
|
|
- if action == #selector(buttonItemClick_CleanAll(_:)) {
|
|
|
- if (self.isBates && KMHeaderFooterManager.defaultManager.onlyBatesObjects.count < 1) || (!self.isBates && KMHeaderFooterManager.defaultManager.onlyHeaderFooterObjects.count < 1){
|
|
|
- return false
|
|
|
- }
|
|
|
- return true
|
|
|
- }
|
|
|
- return true
|
|
|
- }
|
|
|
+
|
|
|
func headerFooterInterfaceSelectHeaderFooter(headerFooter: KMHeaderFooterObject) {
|
|
|
self.tableView.reloadData()
|
|
|
if let index = KMHeaderFooterManager.defaultManager.onlyHeaderFooterObjects.firstIndex(of: headerFooter) {
|
|
@@ -664,3 +655,16 @@ class KMBatchOperateAddHeaderFooterViewController: KMBatchOperateBaseViewControl
|
|
|
NotificationCenter.default.post(name: NSNotification.Name(rawValue: kNeedChangePageRangeNotification), object: nil)
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+extension KMBatchOperateAddHeaderFooterViewController: NSMenuDelegate, NSMenuItemValidation{
|
|
|
+ func validateMenuItem(_ menuItem: NSMenuItem) -> Bool {
|
|
|
+ let action = menuItem.action
|
|
|
+ if action == #selector(buttonItemClick_CleanAll(_:)) {
|
|
|
+ if (self.isBates && KMHeaderFooterManager.defaultManager.onlyBatesObjects.count < 1) || (!self.isBates && KMHeaderFooterManager.defaultManager.onlyHeaderFooterObjects.count < 1){
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ return true
|
|
|
+ }
|
|
|
+ return true
|
|
|
+ }
|
|
|
+}
|