Skip to content

Commit

Permalink
deprecate native.showkeyboard and native.hidekeyboard
Browse files Browse the repository at this point in the history
  • Loading branch information
tlancina committed May 19, 2014
1 parent db43ec6 commit 2d78f93
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
8 changes: 8 additions & 0 deletions js/angular/directive/keyboardAttach.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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);
});
Expand Down
5 changes: 5 additions & 0 deletions js/utils/keyboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down Expand Up @@ -297,6 +301,7 @@ function keyboardHasPlugin() {
}

ionic.Platform.ready(function() {
ionic.Platform.isFullScreen = true;
keyboardUpdateViewportHeight();

// Android sometimes reports bad innerHeight on window.load
Expand Down

0 comments on commit 2d78f93

Please sign in to comment.