|
@@ -25,15 +25,15 @@ class KMNPageEditViewController: KMNThumbnailBaseViewController {
|
|
|
|
|
|
backViewBox.fillColor = ComponentLibrary.shared.getComponentColorFromKey("colorBg/layout-pdfView")
|
|
|
|
|
|
- collectionView.menuClickedAction = { point in
|
|
|
- let menuStruct = self.clickMenu(point: point)
|
|
|
- if self.groupView != nil {
|
|
|
- self.groupView?.clickedAutoHide = false
|
|
|
- self.groupView?.groupDelegate = self
|
|
|
- self.groupView?.frame = CGRectMake(0, 0, 180, menuStruct.viewHeight)
|
|
|
- self.groupView?.updateGroupInfo(menuStruct.menuitems)
|
|
|
+ collectionView.menuClickedAction = {[weak self] point in
|
|
|
+ let menuStruct = self?.clickMenu(point: point)
|
|
|
+ if self?.groupView != nil {
|
|
|
+ self?.groupView?.clickedAutoHide = false
|
|
|
+ self?.groupView?.groupDelegate = self
|
|
|
+ self?.groupView?.frame = CGRectMake(0, 0, 180, menuStruct?.viewHeight ?? 0)
|
|
|
+ self?.groupView?.updateGroupInfo(menuStruct?.menuitems ?? [])
|
|
|
|
|
|
- self.groupView?.showWithPoint(CGPoint(x: point.x, y: point.y - menuStruct.viewHeight), relativeTo: self.collectionView)
|
|
|
+ self?.groupView?.showWithPoint(CGPoint(x: point.x, y: point.y - (menuStruct?.viewHeight ?? 0)), relativeTo: self?.collectionView)
|
|
|
}
|
|
|
return NSMenu()
|
|
|
}
|