Commit b2551715 by Lee Munkyeong

43069対応

parent bd11c0f8
var lastscrollvalue; var lastscrollvalue;
window.onscroll = function() { window.onscroll = function() {
var scrollPosition = window.scrollY || document.documentElement.scrollTop; beforeScroll = window.scrollY;
if (scrollPosition == 0) {
console.log('Scroll on TOP!!');
//TODO add getMessages(newLine);
if (CHAT_UTIL.isIOS()) {
} else if (CHAT_UTIL.isAndroid()) {
//android.getMessages()
}
}
} }
$('#roomNameChangeBtn').click(function() { $('#roomNameChangeBtn').click(function() {
......
...@@ -11,6 +11,10 @@ CHAT.globalLoginParameter; ...@@ -11,6 +11,10 @@ CHAT.globalLoginParameter;
// fermi coview share // fermi coview share
let globalUserInfo = new Object(); let globalUserInfo = new Object();
var beforeHeight = window.innerHeight;
var beforeWidth = window.innerWidth;
var beforeScroll;
CHAT.saveRoomInfo = function(roomId, roomName) { CHAT.saveRoomInfo = function(roomId, roomName) {
CHAT.globalLoginParameter.roomId = roomId; CHAT.globalLoginParameter.roomId = roomId;
CHAT.globalLoginParameter.roomName = roomName; CHAT.globalLoginParameter.roomName = roomName;
...@@ -372,26 +376,38 @@ $(function() { ...@@ -372,26 +376,38 @@ $(function() {
} }
}); });
var beforeHeight;
var beforeScroll;
var footerHeight = $('.footer-wrap').height(); var footerHeight = $('.footer-wrap').height();
window.addEventListener("resize", function() { window.addEventListener("resize", function() {
console.log('aaaa');
var afterHeight = window.innerHeight; var afterHeight = window.innerHeight;
var afterWidth = window.innerWidth;
var moreScroll = beforeHeight - afterHeight;
if (beforeHeight > afterHeight) { if (beforeHeight > afterHeight) {
//キーボード表示時 if (beforeWidth == afterWidth) {
var moreScroll = beforeHeight - afterHeight; //キーボード表示時
$('.room_container').css('margin-bottom', 0); $('.room_container').css('margin-bottom', 0);
window.scrollTo(0, beforeScroll + moreScroll - $('.footer_content_b').height()); window.scrollTo(0, beforeScroll + moreScroll - $('.footer_content_b').height());
} else {
//画面回転時
window.scrollTo(0, beforeScroll + moreScroll);
}
} else { } else {
//キーボード非表示
$('.room_container').css('margin-bottom', footerHeight); $('.room_container').css('margin-bottom', footerHeight);
window.scrollTo(0, beforeScroll); if (beforeWidth == afterWidth) {
//キーボード非表示
window.scrollTo(0, beforeScroll + moreScroll + $('.footer_content_b').height());
} else {
//画面回転時
window.scrollTo(0, beforeScroll + moreScroll);
}
} }
beforeHeight = window.innerHeight;
beforeWidth = window.innerWidth;
}); });
$('#messageInput').focusin(function(e) { $('#messageInput').focusin(function(e) {
beforeHeight = window.innerHeight; beforeHeight = window.innerHeight;
beforeWidth = window.innerWidth;
beforeScroll = window.scrollY; beforeScroll = window.scrollY;
}) })
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment