     }
 
     func updateButtonConstraints() {
-        guard let closeButtonSuperview = self.closeButton.superview else {
-            return
-        }
-        self.closeButton.mas_remakeConstraints({ make in
-            _ = make?.width.equalTo()(44)
-            _ = make?.height.equalTo()(44)
-            switch self.displaySide {
-            case .right:
-                fallthrough
-            case .left:
-                _ = make?.trailing.equalTo()(closeButtonSuperview.mas_trailing)?.offset()(0 - self.closeButtonLeadingPadding)
-                _ = make?.top.equalTo()(self.closeButtonTopPadding + self.statusBarEstimatedHeight)
-                break
-            case .center:
-                fallthrough
-            default:
-                _ = make?.leading.equalTo()(closeButtonSuperview.mas_leading)?.offset()(self.closeButtonLeadingPadding)
-                _ = make?.bottom.equalTo()(closeButtonSuperview.mas_bottom)?.offset()(self.closeButtonTopPadding)
-            }
-            return ()
-        })
+        switch self.displaySide {
+        case .right:
+            fallthrough
+        case .left:
+            closeButtonLeadingConstraint?.isActive = false
+            closeButtonBottomConstraint?.isActive = false
+            closeButtonTrailingConstraint?.isActive = true
+            closeButtonTopConstraint?.isActive = true
+            break
+        case .center:
+            fallthrough
+        default:
+            closeButtonTrailingConstraint?.isActive = false
+            closeButtonTopConstraint?.isActive = false
+            closeButtonLeadingConstraint?.isActive = true
+            closeButtonBottomConstraint?.isActive = true
+        }
+        return ()
     }
 
     

        tap.addTarget(self, action: #selector(WMFTableOfContentsPresentationController.didTap(_:)))
        view.addGestureRecognizer(tap)
        view.contentView.addSubview(self.statusBarBackground)
        view.contentView.addSubview(self.closeButton)
        return view
    }()



    open var minimumVisibleBackgroundWidth: CGFloat = 60.0
    open var maximumTableOfContentsWidth: CGFloat = 300.0
    open var statusBarEstimatedHeight: CGFloat {
        if #available(iOS 11.0, *) {
            return max(UIApplication.shared.statusBarFrame.size.height, presentedView?.safeAreaInsets.top ?? 0)
