Commit a06fafcc by Lee Munkyeong

初対画面バグ修正

parent e22d4630
...@@ -53,10 +53,10 @@ ...@@ -53,10 +53,10 @@
<!-- タブ --> <!-- タブ -->
<div class="content tabs"> <div class="content tabs">
<input id="tabMyGroupOnMakeRoom" type="radio" name="tab_item" checked> <input id="tabMyGroupOnAddUser" type="radio" name="tab_item" checked>
<label class="tab_item" for="tabMyGroupOnMakeRoom">マイグループ</label> <label class="tab_item" for="tabMyGroupOnAddUser">マイグループ</label>
<input id="tabAllGroupOnMakeRoom" type="radio" name="tab_item"> <input id="tabAllGroupOnAddUser" type="radio" name="tab_item">
<label class="tab_item" for="tabAllGroupOnMakeRoom">全グループ</label> <label class="tab_item" for="tabAllGroupOnAddUser">全グループ</label>
<div class="tab_content" id="tab1_content"> <div class="tab_content" id="tab1_content">
<div class="chat_list"> <div class="chat_list">
<!-- お気に入りグループ --> <!-- お気に入りグループ -->
......
...@@ -41,6 +41,11 @@ input[name="tab_item"] { ...@@ -41,6 +41,11 @@ input[name="tab_item"] {
display: block; display: block;
} }
#tabMyGroupOnAddUser:checked ~ #tab1_content,
#tabAllGroupOnAddUser:checked ~ #tab2_content{
display: block;
}
#tabMyGroup:checked ~ #tab1_content, #tabMyGroup:checked ~ #tab1_content,
#tabAllGroup:checked ~ #tab2_content{ #tabAllGroup:checked ~ #tab2_content{
display: block; display: block;
......
...@@ -101,6 +101,15 @@ CHAT_DB.getGroupInfo = function(groupId) { ...@@ -101,6 +101,15 @@ CHAT_DB.getGroupInfo = function(groupId) {
} }
}; };
CHAT_DB.getGroupInfoForAddUser = function(groupId) {
if (CHAT_UTIL.isIOS()) {
//TODO getGroupInfoの処理でユーザ情報にルーム参加者が入ってない処理。
} else if (CHAT_UTIL.isAndroid()) {
//String形式をJsonに変更してReturn
return JSON.parse(android.getGroupInfoForAddUser(groupId));
}
};
CHAT_DB.loadSelectedUsers = function() { CHAT_DB.loadSelectedUsers = function() {
if (CHAT_UTIL.isIOS()) { if (CHAT_UTIL.isIOS()) {
return JSON.parse(callNativeApp("getSelectedUserList", {})); return JSON.parse(callNativeApp("getSelectedUserList", {}));
......
...@@ -206,7 +206,7 @@ CHAT_UI.sendMessage = function(e) { ...@@ -206,7 +206,7 @@ CHAT_UI.sendMessage = function(e) {
, 0 , 0
); );
} }
$('.message_input_group').focus(); $('.message_input_form').focus();
} }
//メッセージ送信 //メッセージ送信
$('#messageInput').on('keypress', function(event) { $('#messageInput').on('keypress', function(event) {
...@@ -1316,6 +1316,13 @@ $('#tabAllGroupOnMakeRoom').on('click', function(e) { ...@@ -1316,6 +1316,13 @@ $('#tabAllGroupOnMakeRoom').on('click', function(e) {
CHAT_UI.refreshAllGroupForMakeRoom('0'); CHAT_UI.refreshAllGroupForMakeRoom('0');
}); });
$('#tabMyGroupOnAddUser').on('click', function(e) {
CHAT_UI.refreshMyGroupForAddUser();
});
$('#tabAllGroupOnAddUser').on('click', function(e) {
CHAT_UI.refreshAllGroupForAddUser('0');
});
$('#makeRoomConfirmBtn').on('click', function(e) { $('#makeRoomConfirmBtn').on('click', function(e) {
if (typeof(android) != "undefined") { if (typeof(android) != "undefined") {
android.saveSelectedUserList(CHAT.globalSelectedUserList.join(",")); android.saveSelectedUserList(CHAT.globalSelectedUserList.join(","));
...@@ -2202,6 +2209,116 @@ CHAT_UI.refreshMyGroupForAddUser = function() { ...@@ -2202,6 +2209,116 @@ CHAT_UI.refreshMyGroupForAddUser = function() {
}) })
} }
CHAT_UI.refreshAllGroupForAddUser = function(paramGroupId) {
var groupId = paramGroupId;
$('.cancel').addClass('none');
$('.search_form input').removeClass('focus');
$('.search_form input').val('');
$('.search_form form').removeClass();
$('.content').removeClass('none');
$('.overlay_src_msg').empty();
$('#tabAllGroupOnAllUser').prop('checked', true);
//オンライン状態であればサーバから情報更新。
if (IS_ONLINE == 'true') {
if (typeof(android) != "undefined") {
android.updateGroupInfo(groupId);
} else {
webkit.messageHandlers.updateGroupInfo.postMessage(groupId);
}
}
//画面エリアを初期化。
$('#parentGroupBtnForMakeRoom').off();
$('#rootGroupBtnForMakeRoom').off();
$('#childGroupListAreaForMakeRoom').html('');
$('#userInGroupListForMakeRoom').html('');
$('#groupPathAreaForMakeRoom').html('');
//DBからグループ情報を取得。
var result = CHAT_DB.getGroupInfoForAddUser(groupId);
//上位グループ、トップグループ遷移ボタンのイベント追加。
if (typeof result.parentGroupId !== 'undefined') {
$('#parentGroupBtnForMakeRoom').on('click', function() {
CHAT_UI.refreshAllGroupForAddUser(result.parentGroupId);
});
}
if (typeof result.rootGroupId !== 'undefined') {
if (paramGroupId == 0) { groupId = result.rootGroupId }
$('#rootGroupBtnForMakeRoom').on('click', function() {
CHAT_UI.refreshAllGroupForAddUser(result.rootGroupId);
});
}
if (groupId == result.rootGroupId || paramGroupId == '0') {
$('#rootGroupArea').addClass('none');
$('#parentGroupArea').addClass('none');
} else {
$('#rootGroupArea').removeClass('none');
$('#parentGroupArea').removeClass('none');
}
//該当グループのパースを表示。
var groupPathTemplate;
$.get({ url: "./template/template_make_room_group_path.html", async: false }
, function(text) {
groupPathTemplate = text;
});
var groupPathCount = 0;
result.groupPathList.forEach(function(groupPath) {
if (!(groupPathCount < (result.groupPathList.length - 3))) {
let html = Mustache.render(groupPathTemplate, {
name: groupPath.groupName,
id: groupPath.groupId
});
let obj = jQuery.parseHTML(html);
$('#groupPathAreaForMakeRoom').append(obj);
}
groupPathCount++;
})
//該当グループの下位グループ表示。
var groupTemplate;
$.get({ url: "./template/template_make_room_group_list.html", async: false }
, function(text) {
groupTemplate = text;
});
result.childGroupList.forEach(function(childGroup) {
let html = Mustache.render(groupTemplate, {
name: childGroup.groupName,
id: childGroup.groupId,
});
let obj = $(jQuery.parseHTML(html)).on('click', function() {
});
$('#childGroupListAreaForMakeRoom').append(obj);
})
//該当グループの所属ユーザを表示。
var userTemplate;
$.get({ url: "./template/template_make_room_user_list.html", async: false }
, function(text) {
userTemplate = text;
});
result.groupUserList.forEach(function(groupUser) {
groupUser.profileUrl = CHAT.getProfileImgUrl(groupUser.profileUrl)
let findObj = CHAT.globalSelectedUserList.find(function(shopMemberId) {
return shopMemberId == groupUser.shopMemberId;
})
if (findObj) {
groupUser.checked = 'checked';
}
})
let html = Mustache.render(userTemplate, {
userList: result.groupUserList
});
let obj = jQuery.parseHTML(html);
$('#userInGroupListForMakeRoom').append(obj);
};
CHAT_UI.refreshForOnline = function() { CHAT_UI.refreshForOnline = function() {
IS_ONLINE = 'true'; IS_ONLINE = 'true';
$('.craeteRoomButton').show(); $('.craeteRoomButton').show();
......
...@@ -46,7 +46,7 @@ $(function() { ...@@ -46,7 +46,7 @@ $(function() {
$('.craeteRoomButton').removeClass('none'); $('.craeteRoomButton').removeClass('none');
}); });
$('.message_input_form').click(function(){ $('.message_input_form').on('focus',function(e){
$('.message_input_send').removeClass('none'); $('.message_input_send').removeClass('none');
$('.attach_file').addClass('none'); $('.attach_file').addClass('none');
$('.footer_content_b').addClass('none'); $('.footer_content_b').addClass('none');
...@@ -55,9 +55,10 @@ $(function() { ...@@ -55,9 +55,10 @@ $(function() {
$('.message_input_form').on('focusout',function(e){ $('.message_input_form').on('focusout',function(e){
if($(e.relatedTarget).hasClass('message_input_send')){ if($(e.relatedTarget).hasClass('message_input_send')){
CHAT_UI.sendMessage(); CHAT_UI.sendMessage();
} else {
$('.message_input_send').addClass('none');
$('.attach_file').removeClass('none');
$('.footer_content_b').removeClass('none');
} }
$('.message_input_send').addClass('none');
$('.attach_file').removeClass('none');
$('.footer_content_b').removeClass('none');
}); });
}); });
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