Commit ed707c97 by Lee Munkyeong

Merge branch 'feature/fix_error_javascript' into 'develop'

スクリプト共通化不具合対応。

See merge request !183
parents 43895f05 26e3dd3e
...@@ -19,17 +19,17 @@ CHAT_ADD_USER.searchUser = function (keyword) { ...@@ -19,17 +19,17 @@ CHAT_ADD_USER.searchUser = function (keyword) {
if (isAllGroup) { if (isAllGroup) {
//グループデータ検索 //グループデータ検索
const groupList = CHAT_DB.getGroupByName(keyword); const groupList = CHAT_DB.getGroupByName(keyword);
searchGroupData(groupList); searchGroupData(groupList, overlayMessage);
//ユーザデータ検索 //ユーザデータ検索
var userList = CHAT_DB.getAllGroupShopMemberNotInRoomByName(keyword); var userList = CHAT_DB.getAllGroupShopMemberNotInRoomByName(keyword);
searchUserData(userList); searchUserData(userList, overlayMessage);
hasNoData = userList.length == 0 && groupList.length == 0; hasNoData = userList.length == 0 && groupList.length == 0;
//連絡先画面 //連絡先画面
} else { } else {
var userList = CHAT_DB.getMyGroupShopMemberNotInRoomByName(keyword); var userList = CHAT_DB.getMyGroupShopMemberNotInRoomByName(keyword);
searchUserData(userList); searchUserData(userList, overlayMessage);
hasNoData = userList.length == 0; hasNoData = userList.length == 0;
} }
// Set NoResult // Set NoResult
...@@ -84,7 +84,7 @@ var bindiOSKeyBoardEvent = function () { ...@@ -84,7 +84,7 @@ var bindiOSKeyBoardEvent = function () {
}); });
}; };
var searchGroupData = function (groupList) { var searchGroupData = function (groupList, overlayMessage) {
const groupTemplate = getTemplate(TemplateURL.MAKE_ROOM_GROUP_LIST); const groupTemplate = getTemplate(TemplateURL.MAKE_ROOM_GROUP_LIST);
groupList.forEach(function (group) { groupList.forEach(function (group) {
...@@ -106,8 +106,8 @@ var renderGroupTemplate = function (groupTemplate, groupName, groupID) { ...@@ -106,8 +106,8 @@ var renderGroupTemplate = function (groupTemplate, groupName, groupID) {
}); });
}; };
var searchUserData = function (userList) { var searchUserData = function (userList, overlayMessage) {
const userTemplate = getTemplate(TemplateURL.MAKE_ROOM_GROUP_LIST); const userTemplate = getTemplate(TemplateURL.MAKE_ROOM_USER_LIST);
userList.forEach(function (user) { userList.forEach(function (user) {
setUserProfile(user); setUserProfile(user);
checkUser(user); checkUser(user);
......
...@@ -23,8 +23,7 @@ CHAT_MAKE_ROOM.searchUser = function (keyword) { ...@@ -23,8 +23,7 @@ CHAT_MAKE_ROOM.searchUser = function (keyword) {
var groupTemplate = getTemplate(TemplateURL.MAKE_ROOM_GROUP_LIST); var groupTemplate = getTemplate(TemplateURL.MAKE_ROOM_GROUP_LIST);
groupList.forEach(function (group) { groupList.forEach(function (group) {
renderRoomList(groupTemplate, group.groupName, group.groupId); let html = renderRoomList(groupTemplate, group.groupName, group.groupId);
let obj = jQuery.parseHTML(html); let obj = jQuery.parseHTML(html);
overlayMessage.append(obj); overlayMessage.append(obj);
}); });
...@@ -40,7 +39,7 @@ CHAT_MAKE_ROOM.searchUser = function (keyword) { ...@@ -40,7 +39,7 @@ CHAT_MAKE_ROOM.searchUser = function (keyword) {
//連絡先画面 //連絡先画面
} else { } else {
const userList = CHAT_DB.getMyGroupShopMemberByName(keyword); const userList = CHAT_DB.getMyGroupShopMemberByName(keyword);
searchUserData(); searchUserData(userList);
var userTemplate = getTemplate(TemplateURL.MAKE_ROOM_USER_LIST); var userTemplate = getTemplate(TemplateURL.MAKE_ROOM_USER_LIST);
let html = renderUser(userTemplate, userList); let html = renderUser(userTemplate, userList);
let obj = jQuery.parseHTML(html); let obj = jQuery.parseHTML(html);
...@@ -64,11 +63,11 @@ var searchMember = function () { ...@@ -64,11 +63,11 @@ var searchMember = function () {
$("#makeRoomTitle").text(contactListTitle); $("#makeRoomTitle").text(contactListTitle);
}); });
searchInput.keyup(function (e) { searchInput.keyup(function (e) {
var keyword = searchInput.val();
const enterKeyPressed = e.KeyCode == 13 || e.key == "Enter"; const enterKeyPressed = e.KeyCode == 13 || e.key == "Enter";
const keywordEmpty = keyword == "" || keyword.length < 2; const keywordEmpty = keyword == "" || keyword.length < 2;
const keywordNotEmpty = keyword != "" && keyword.length != 0; const keywordNotEmpty = keyword != "" && keyword.length != 0;
//画面タイトル設定 //画面タイトル設定
var keyword = searchInput.val();
if (enterKeyPressed) { if (enterKeyPressed) {
if (keywordNotEmpty) { if (keywordNotEmpty) {
searchInput.blur(); searchInput.blur();
......
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