Skip to content

Instantly share code, notes, and snippets.

@cggaurav
Created October 7, 2015 17:12
Show Gist options
  • Save cggaurav/2d448af516718378c9b6 to your computer and use it in GitHub Desktop.
Save cggaurav/2d448af516718378c9b6 to your computer and use it in GitHub Desktop.
Move Input with the cordova plugin
var moveInput = function(height) {
if (ionic.Platform.isAndroid()) {
// console.info('moveInput()', height, "Wait, what is $scope.keyboardHeight", $scope.keyboardHeight)
height = height || 0;
// if (height === 0) {
// document.getElementById('message-footer').setAttribute('style', 'margin-bottom: 0px;');
// document.getElementById('message-wrapper').setAttribute('style', 'height: auto');
// } else {
// document.getElementById('message-footer').setAttribute('style', ['margin-bottom: ', height.toString(), 'px;'].join(''));
// document.getElementById('message-wrapper').setAttribute('style', ['height: ', window.innerHeight - $scope.keyboardHeight - 90, 'px;'].join(''));
// }
scrollToBottom(true);
}
if (ionic.Platform.isIOS()) {
// if (height === 0) {
// document.getElementById('message-wrapper').setAttribute('style', 'height: auto');
// }else{
// document.getElementById('message-wrapper').setAttribute('style', ['height: ', window.innerHeight - $scope.keyboardHeight - 90, 'px;'].join(''));
// }
scrollToBottom(true);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment