Created
October 7, 2015 17:12
-
-
Save cggaurav/2d448af516718378c9b6 to your computer and use it in GitHub Desktop.
Move Input with the cordova plugin
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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