From 2d78f93a747f84f7f4f2a34ba88d9ed2fae8484d Mon Sep 17 00:00:00 2001 From: Tim Lancina Date: Mon, 19 May 2014 14:43:25 -0500 Subject: [PATCH] deprecate native.showkeyboard and native.hidekeyboard --- js/angular/directive/keyboardAttach.js | 8 ++++++++ js/utils/keyboard.js | 5 +++++ 2 files changed, 13 insertions(+) diff --git a/js/angular/directive/keyboardAttach.js b/js/angular/directive/keyboardAttach.js index e162537cab1..4bd387a6628 100644 --- a/js/angular/directive/keyboardAttach.js +++ b/js/angular/directive/keyboardAttach.js @@ -21,9 +21,14 @@ IonicModule .directive('keyboardAttach', function() { return function(scope, element, attrs) { + window.addEventListener('native.keyboardshow', onShow); + window.addEventListener('native.keyboardhide', onHide); + + //deprecated window.addEventListener('native.showkeyboard', onShow); window.addEventListener('native.hidekeyboard', onHide); + var scrollCtrl; function onShow(e) { @@ -44,6 +49,9 @@ IonicModule } scope.$on('$destroy', function() { + window.removeEventListener('native.keyboardshow', onShow); + window.removeEventListener('native.keyboardhide', onHide); + window.removeEventListener('native.showkeyboard', onShow); window.removeEventListener('native.hidekeyboard', onHide); }); diff --git a/js/utils/keyboard.js b/js/utils/keyboard.js index 3b69100e55c..2b93fd8a417 100644 --- a/js/utils/keyboard.js +++ b/js/utils/keyboard.js @@ -72,6 +72,10 @@ ionic.keyboard = { function keyboardInit() { if( keyboardHasPlugin() ) { + window.addEventListener('native.keyboardshow', keyboardNativeShow); + window.addEventListener('native.keyboardhide', keyboardFocusOut); + + //deprecated window.addEventListener('native.showkeyboard', keyboardNativeShow); window.addEventListener('native.hidekeyboard', keyboardFocusOut); } @@ -297,6 +301,7 @@ function keyboardHasPlugin() { } ionic.Platform.ready(function() { + ionic.Platform.isFullScreen = true; keyboardUpdateViewportHeight(); // Android sometimes reports bad innerHeight on window.load