You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by sh...@apache.org on 2013/11/04 23:05:32 UTC

[18/40] git commit: Removed global var in Keyboard plugin

Removed global var in Keyboard plugin


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

Branch: refs/heads/master
Commit: 733a52911609cab66ebb7845119a026c1a911d80
Parents: 9b6c3c8
Author: Shazron Abdullah <sh...@apache.org>
Authored: Mon Oct 7 13:45:45 2013 -0700
Committer: Shazron Abdullah <sh...@apache.org>
Committed: Mon Oct 7 13:45:45 2013 -0700

----------------------------------------------------------------------
 keyboard/src/ios/CDVKeyboard.h | 2 ++
 keyboard/src/ios/CDVKeyboard.m | 6 ++----
 2 files changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugins/blob/733a5291/keyboard/src/ios/CDVKeyboard.h
----------------------------------------------------------------------
diff --git a/keyboard/src/ios/CDVKeyboard.h b/keyboard/src/ios/CDVKeyboard.h
index 816fc92..f59294c 100644
--- a/keyboard/src/ios/CDVKeyboard.h
+++ b/keyboard/src/ios/CDVKeyboard.h
@@ -30,6 +30,8 @@
     id _hideFormAccessoryBarKeyboardShowObserver, _hideFormAccessoryBarKeyboardHideObserver;
     @protected
     id _shrinkViewKeyboardShowObserver, _shrinkViewKeyboardHideObserver;
+    @protected
+    CGFloat _accessoryBarHeight;
 }
 
 @property (readwrite, assign) BOOL shrinkView;

http://git-wip-us.apache.org/repos/asf/cordova-plugins/blob/733a5291/keyboard/src/ios/CDVKeyboard.m
----------------------------------------------------------------------
diff --git a/keyboard/src/ios/CDVKeyboard.m b/keyboard/src/ios/CDVKeyboard.m
index 40b1cd4..06131e8 100644
--- a/keyboard/src/ios/CDVKeyboard.m
+++ b/keyboard/src/ios/CDVKeyboard.m
@@ -187,7 +187,6 @@
 
 // //////////////////////////////////////////////////
 
-CGFloat gAccessoryBarHeight = 0.0;
 - (void)formAccessoryBarKeyboardWillShow:(NSNotification*)notif
 {
     if (!_hideFormAccessoryBar) {
@@ -212,7 +211,7 @@ CGFloat gAccessoryBarHeight = 0.0;
                         newFrame.size.height += peripheralView.frame.size.height;
                         self.webView.scrollView.frame = newFrame;
 
-                        gAccessoryBarHeight = peripheralView.frame.size.height;
+                        _accessoryBarHeight = peripheralView.frame.size.height;
 
                         // remove the form accessory bar
                         [peripheralView removeFromSuperview];
@@ -248,8 +247,7 @@ CGFloat gAccessoryBarHeight = 0.0;
     keyboardFrame = [self.viewController.view convertRect:keyboardFrame fromView:nil];
 
     CGRect newFrame = self.viewController.view.bounds;
-    CGFloat accessoryHeight = gAccessoryBarHeight;
-    CGFloat actualKeyboardHeight = (keyboardFrame.size.height - accessoryHeight);
+    CGFloat actualKeyboardHeight = (keyboardFrame.size.height - _accessoryBarHeight);
     newFrame.size.height -= actualKeyboardHeight;
 
     self.webView.frame = newFrame;