mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
android fullscreen tweaks
This commit is contained in:
@@ -23,12 +23,15 @@ ionic.keyboard = {
|
||||
function keyboardInit() {
|
||||
if( keyboardHasPlugin() ) {
|
||||
window.addEventListener('native.showkeyboard', keyboardNativeShow);
|
||||
window.addEventListener('native.hidekeyboard', keyboardFocusOut);
|
||||
}
|
||||
else {
|
||||
document.body.addEventListener('focusout', keyboardFocusOut);
|
||||
}
|
||||
|
||||
document.body.addEventListener('ionic.focusin', keyboardBrowserFocusIn);
|
||||
document.body.addEventListener('focusin', keyboardBrowserFocusIn);
|
||||
|
||||
document.body.addEventListener('focusout', keyboardFocusOut);
|
||||
document.body.addEventListener('orientationchange', keyboardOrientationChange);
|
||||
|
||||
document.removeEventListener('touchstart', keyboardInit);
|
||||
@@ -86,6 +89,8 @@ function keyboardShow(element, elementTop, elementBottom, viewportHeight, keyboa
|
||||
keyboardHeight: keyboardHeight
|
||||
};
|
||||
|
||||
details.hasPlugin = keyboardHasPlugin();
|
||||
|
||||
details.contentHeight = viewportHeight - keyboardHeight;
|
||||
|
||||
console.debug('keyboardShow', keyboardHeight, details.contentHeight);
|
||||
|
||||
@@ -640,6 +640,15 @@ ionic.views.Scroll = ionic.views.View.inherit({
|
||||
|
||||
//If the element is positioned under the keyboard...
|
||||
if( e.detail.isElementUnderKeyboard ) {
|
||||
var delay;
|
||||
// Wait on android for scroll view to resize
|
||||
if ( !ionic.Platform.isFullScreen && e.detail.hasPlugin ) {
|
||||
delay = 350;
|
||||
}
|
||||
else {
|
||||
delay = 80;
|
||||
}
|
||||
|
||||
//Put element in middle of visible screen
|
||||
//Wait for resize() to reset scroll position
|
||||
ionic.scroll.isScrolling = true;
|
||||
@@ -651,7 +660,7 @@ ionic.views.Scroll = ionic.views.View.inherit({
|
||||
ionic.tap.cloneFocusedInput(container, self);
|
||||
self.scrollBy(0, scrollTop, true);
|
||||
self.onScroll();
|
||||
}, 80 );
|
||||
}, delay);
|
||||
}
|
||||
|
||||
//Only the first scrollView parent of the element that broadcasted this event
|
||||
|
||||
Reference in New Issue
Block a user