         let menuCenterX : CGFloat = configuration.menuWidth/2 + FTDefaultMargin
         if senderRect.origin.y + senderRect.size.height/2 < UIScreen.ft_height()/2 {
             point.y = 0
-        }else{
+        } else {
             point.y = popMenuHeight
         }
-        if (point.x + menuCenterX > UIScreen.ft_width()) {
+        if point.x + menuCenterX > UIScreen.ft_width() {
             point.x = min(point.x - (UIScreen.ft_width() - configuration.menuWidth - FTDefaultMargin), configuration.menuWidth - FTDefaultMenuArrowWidth - FTDefaultMargin)
-        }else if (point.x - menuCenterX < 0){
+        } else if point.x - menuCenterX < 0 {
             point.x = max(FTDefaultMenuCornerRadius + FTDefaultMenuArrowWidth, point.x - FTDefaultMargin)
-        }else{
+        } else {
             point.x = configuration.menuWidth/2
         }
         menuArrowPoint = point

        self.configureMenuArrowPoint()
        self.configurePopMenuOriginX()
        
        if (arrowDirection == .Up) {
            popMenuFrame = CGRect(x: popMenuOriginX, y: (senderRect.origin.y + senderRect.size.height), width: configuration.menuWidth, height: popMenuHeight)
            if (popMenuFrame.origin.y + popMenuFrame.size.height > UIScreen.ft_height()) {
                popMenuFrame = CGRect(x: popMenuOriginX, y: (senderRect.origin.y + senderRect.size.height), width: configuration.menuWidth, height: UIScreen.ft_height() - popMenuFrame.origin.y - FTDefaultMargin)
            }
        }else{
            popMenuFrame = CGRect(x: popMenuOriginX, y: (senderRect.origin.y - popMenuHeight), width: configuration.menuWidth, height: popMenuHeight)
            if (popMenuFrame.origin.y  < 0) {
                popMenuFrame = CGRect(x: popMenuOriginX, y: FTDefaultMargin, width: configuration.menuWidth, height: senderRect.origin.y - FTDefaultMargin)
            }
        }

                    if (self.cancel != nil) {
                        self.cancel()
                    }
                } else {
                    if self.done != nil {
                        self.done(selectedIndex)
                    }
                }
