You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by ag...@apache.org on 2015/03/30 16:12:59 UTC

[5/6] cordova-plugins git commit: Take into account whether or not the accessory bar is showing when shrinking the webview.

Take into account whether or not the accessory bar is showing when shrinking the webview.


Project: http://git-wip-us.apache.org/repos/asf/cordova-plugins/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugins/commit/3a12b968
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugins/tree/3a12b968
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugins/diff/3a12b968

Branch: refs/heads/master
Commit: 3a12b968e010cc489dfe56e477dfc0a4e72279ee
Parents: 12911f6
Author: Connor Pearson <cj...@gmail.com>
Authored: Mon Jan 12 12:15:58 2015 -0500
Committer: Andrew Grieve <ag...@chromium.org>
Committed: Mon Mar 30 10:12:23 2015 -0400

----------------------------------------------------------------------
 keyboard/src/ios/CDVKeyboard.m | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugins/blob/3a12b968/keyboard/src/ios/CDVKeyboard.m
----------------------------------------------------------------------
diff --git a/keyboard/src/ios/CDVKeyboard.m b/keyboard/src/ios/CDVKeyboard.m
index 9d557a8..7df567a 100644
--- a/keyboard/src/ios/CDVKeyboard.m
+++ b/keyboard/src/ios/CDVKeyboard.m
@@ -101,6 +101,8 @@
                                                              }];
     
     self.webView.scrollView.delegate = self;
+    
+    _accessoryBarHeight = 44;
 }
 
 // //////////////////////////////////////////////////
@@ -269,8 +271,13 @@
     CGRect keyboard = [self.viewController.view convertRect: ((NSValue*)notif.userInfo[@"UIKeyboardFrameEndUserInfoKey"]).CGRectValue fromView: nil];
     CGRect keyboardIntersection = CGRectIntersection(screen, keyboard);
 
-    if(CGRectContainsRect(screen, keyboardIntersection) && _shrinkView){
+    if(CGRectContainsRect(screen, keyboardIntersection) && !CGRectIsEmpty(keyboardIntersection)&& _shrinkView){
         screen.size.height -= MIN(keyboardIntersection.size.height, keyboardIntersection.size.width);
+        
+        if (_hideFormAccessoryBar){
+            screen.size.height += _accessoryBarHeight;
+        }
+        
         self.webView.scrollView.scrollEnabled = !self.disableScrollingInShrinkView;
     }
     


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org