Brion VIBBER has submitted this change and it was merged.

Change subject: When editing captcha is visible, editing window is now properly 
hidden.
......................................................................


When editing captcha is visible, editing window is now properly hidden.

When editing captcha is visible, cancel button now returns user to the
editing interface rather than canceling out of the edit entirely.

Change-Id: I1e11da4d6d9b6ad2f08d32a854af8c9321f880a0
---
M Wikipedia-iOS/View Controllers/SectionEditor/SectionEditorViewController.m
1 file changed, 26 insertions(+), 0 deletions(-)

Approvals:
  Brion VIBBER: Verified; Looks good to me, approved



diff --git a/Wikipedia-iOS/View 
Controllers/SectionEditor/SectionEditorViewController.m b/Wikipedia-iOS/View 
Controllers/SectionEditor/SectionEditorViewController.m
index 837f043..df1a9bd 100644
--- a/Wikipedia-iOS/View Controllers/SectionEditor/SectionEditorViewController.m
+++ b/Wikipedia-iOS/View Controllers/SectionEditor/SectionEditorViewController.m
@@ -189,6 +189,21 @@
                                                          }];
 }
 
+-(void)setShowCaptchaContainer:(BOOL)showCaptchaContainer
+{
+    if (_showCaptchaContainer != showCaptchaContainer) {
+        _showCaptchaContainer = showCaptchaContainer;
+        if (showCaptchaContainer){
+            self.editTextView.alpha = 0.0;
+            [self.captchaTextBox 
performSelector:@selector(becomeFirstResponder) withObject:nil afterDelay:0.4f];
+            self.editTextView.userInteractionEnabled = NO;
+        }else{
+            self.editTextView.alpha = 1.0;
+            self.editTextView.userInteractionEnabled = YES;
+        }
+    }
+}
+
 - (void)savePushed:(id)sender
 {
     // Use static flag to prevent save when save already in progress.
@@ -440,6 +455,17 @@
 
 - (void)cancelPushed:(id)sender
 {
+    if (self.showCaptchaContainer) {
+        [self showAlert:@""];
+        [UIView animateWithDuration:0.3f animations:^{
+            self.showCaptchaContainer = NO;
+            [self.captchaContainer.superview setNeedsUpdateConstraints];
+            [self.captchaContainer.superview layoutIfNeeded];
+        } completion:^(BOOL done){
+        }];
+        return;
+    }
+
     [self hide];
 }
 

-- 
To view, visit https://gerrit.wikimedia.org/r/114090
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I1e11da4d6d9b6ad2f08d32a854af8c9321f880a0
Gerrit-PatchSet: 1
Gerrit-Project: apps/ios/wikipedia
Gerrit-Branch: master
Gerrit-Owner: Mhurd <mh...@wikimedia.org>
Gerrit-Reviewer: Brion VIBBER <br...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to