Commit 2917675a by Kim Peace

Merge branch 'bug/#43889_namecard_and_favorite' into 'develop'

Fixed for contact and namecard for favorite

See merge request !223
parents 0757186e 485b0deb
...@@ -10,6 +10,10 @@ window.onscroll = function () { ...@@ -10,6 +10,10 @@ window.onscroll = function () {
return; return;
} }
beforeScroll = window.scrollY; beforeScroll = window.scrollY;
ChatRoom.prependMessageWhenScrollIfNeeded();
};
ChatRoom.prependMessageWhenScrollIfNeeded = function () {
const beforeHeight = $(".room_container").height(); const beforeHeight = $(".room_container").height();
messageCount = $(".chat_message").length; messageCount = $(".chat_message").length;
if ($(this).scrollTop() === 0 && messageCount >= PagingSize.MESSAGE) { if ($(this).scrollTop() === 0 && messageCount >= PagingSize.MESSAGE) {
......
...@@ -185,14 +185,6 @@ CollaborationUI.refreshForOffline = function () { ...@@ -185,14 +185,6 @@ CollaborationUI.refreshForOffline = function () {
} }
}; };
CollaborationUI.showLoadingIndicator = function () {
$("#loadingIndicator").addClass("full_active");
};
CollaborationUI.hideLoadingIndicator = function () {
$("#loadingIndicator").removeClass("full_active");
};
CollaborationUI.displayAddUserButtonIfNeeded = function () { CollaborationUI.displayAddUserButtonIfNeeded = function () {
if (roomInfo.roomType == ChatRoomType.DM) { if (roomInfo.roomType == ChatRoomType.DM) {
$(".add_user_btn").removeClass("none"); $(".add_user_btn").removeClass("none");
......
...@@ -28,7 +28,6 @@ CoviewBridge.bindFermiWebSocketOpenned = function () { ...@@ -28,7 +28,6 @@ CoviewBridge.bindFermiWebSocketOpenned = function () {
CoviewBridge.bindStartEvent = function () { CoviewBridge.bindStartEvent = function () {
coview_api.addEventListener("start", function () { coview_api.addEventListener("start", function () {
CollaborationFeature.enableScrollLock(); CollaborationFeature.enableScrollLock();
CollaborationUI.hideLoadingIndicator();
}); });
}; };
...@@ -84,14 +83,11 @@ CoviewBridge.bindAllByeEvent = function () { ...@@ -84,14 +83,11 @@ CoviewBridge.bindAllByeEvent = function () {
NativeBridgeDelegate.showExitHostAlert(); NativeBridgeDelegate.showExitHostAlert();
return; return;
} }
CollaborationUI.hideLoadingIndicator();
}); });
}; };
CoviewBridge.bindGuestByeEvent = function () { CoviewBridge.bindGuestByeEvent = function () {
coview_api.addEventListener("guestbye", function () { coview_api.addEventListener("guestbye", function () {});
CollaborationUI.hideLoadingIndicator();
});
}; };
CoviewBridge.bindDestroyEvent = function () { CoviewBridge.bindDestroyEvent = function () {
...@@ -99,7 +95,6 @@ CoviewBridge.bindDestroyEvent = function () { ...@@ -99,7 +95,6 @@ CoviewBridge.bindDestroyEvent = function () {
CHAT_SOCKET.emitCollaborationFinishMessage(); CHAT_SOCKET.emitCollaborationFinishMessage();
alert(getLocalizedString("inform_exit_host_collaboration")); alert(getLocalizedString("inform_exit_host_collaboration"));
CoviewBridge.exitCollaboration(); CoviewBridge.exitCollaboration();
CollaborationUI.hideLoadingIndicator();
}); });
}; };
...@@ -231,7 +226,6 @@ CollaborationFeature.didReceivedJoinRoomInfoResponseMessage = function () { ...@@ -231,7 +226,6 @@ CollaborationFeature.didReceivedJoinRoomInfoResponseMessage = function () {
alert(getLocalizedString("not_exist_sharing_call")); alert(getLocalizedString("not_exist_sharing_call"));
coview_api.LeaveRoom(); coview_api.LeaveRoom();
$(".coview_share_area").hide(); $(".coview_share_area").hide();
CollaborationUI.hideLoadingIndicator();
NativeBridgeDelegate.joinRoom(roomInfo.roomID, roomInfo.roomName); NativeBridgeDelegate.joinRoom(roomInfo.roomID, roomInfo.roomName);
}; };
...@@ -498,7 +492,6 @@ CollaborationUI.refreshJoinedCollaboration = function (loginIDList) { ...@@ -498,7 +492,6 @@ CollaborationUI.refreshJoinedCollaboration = function (loginIDList) {
}; };
CollaborationUI.moveToVideoShareArea = function () { CollaborationUI.moveToVideoShareArea = function () {
CollaborationUI.showLoadingIndicator();
$(".coview_share_area").show(); $(".coview_share_area").show();
$("#collabo_main").removeClass("none"); $("#collabo_main").removeClass("none");
}; };
...@@ -143,9 +143,7 @@ Contact.refreshContactScreen = function () { ...@@ -143,9 +143,7 @@ Contact.refreshContactScreen = function () {
Contact.appendMyNamecard(); Contact.appendMyNamecard();
Contact.appendFavoritGroupList(); Contact.reloadFavoriteList();
Contact.appendFavoritUsers();
Contact.appendMyGroupList(); Contact.appendMyGroupList();
...@@ -173,6 +171,12 @@ Contact.appendMyNamecard = function () { ...@@ -173,6 +171,12 @@ Contact.appendMyNamecard = function () {
$("#myImg").attr("src", myInfo.profileImagePath); $("#myImg").attr("src", myInfo.profileImagePath);
}; };
Contact.reloadFavoriteList = function () {
$("#favoriteList").html("");
Contact.appendFavoritGroupList();
Contact.appendFavoritUsers();
};
Contact.appendFavoritGroupList = function () { Contact.appendFavoritGroupList = function () {
// グループの様式を読み込む // グループの様式を読み込む
const groupTemplate = getTemplate(TemplateURL.GROUP_LIST); const groupTemplate = getTemplate(TemplateURL.GROUP_LIST);
...@@ -221,37 +225,35 @@ Contact.appendMyGroupList = function () { ...@@ -221,37 +225,35 @@ Contact.appendMyGroupList = function () {
}; };
Contact.favoriteGroupChange = function (groupID, star) { Contact.favoriteGroupChange = function (groupID, star) {
if ($(star).hasClass("active")) { const div = $(star);
Contact.removeFavoriteGroup(groupID); if (div.hasClass("sp-circle")) {
} else if ($(star).hasClass("disable")) { return;
Contact.insertFavoriteGroup(groupID);
} }
div.removeClass("star");
div.addClass("sp-circle");
setTimeout(() => {
if (div.hasClass("active")) {
Contact.removeFavoriteGroup(groupID, div);
} else if (div.hasClass("disable")) {
Contact.insertFavoriteGroup(groupID, div);
}
div.removeClass("sp-circle");
div.addClass("star");
Contact.reloadFavoriteList();
}, 0);
}; };
Contact.removeFavoriteGroup = function (groupID) { Contact.removeFavoriteGroup = function (groupID, div) {
Common.showLoadingIndicator(); const result = NativeBridgeDataSource.removeFavoriteGroup(groupID);
var result = NativeBridgeDataSource.removeFavoriteGroup(groupID); div.removeClass(result ? "active" : "disable");
if (result) { div.addClass(result ? "disable" : "active");
$(".group_" + groupID).removeClass("active");
$(".group_" + groupID).addClass("disable");
} else {
$(".group_" + groupID).addClass("active");
$(".group_" + groupID).removeClass("disable");
}
Common.dismissLoadingIndicator();
}; };
Contact.insertFavoriteGroup = function (groupID) { Contact.insertFavoriteGroup = function (groupID, div) {
Common.showLoadingIndicator();
const result = NativeBridgeDataSource.addFavoriteGroup(groupID); const result = NativeBridgeDataSource.addFavoriteGroup(groupID);
if (result) { div.removeClass(result ? "disable" : "active");
$(".group_" + groupID).removeClass("disable"); div.addClass(result ? "active" : "disable");
$(".group_" + groupID).addClass("active");
} else {
$(".group_" + groupID).addClass("disable");
$(".group_" + groupID).removeClass("active");
}
Common.dismissLoadingIndicator();
}; };
//全グループ検索画面表示。 //全グループ検索画面表示。
......
...@@ -63,40 +63,44 @@ Namecard.startVoice = function (userShopMemberID, userName) { ...@@ -63,40 +63,44 @@ Namecard.startVoice = function (userShopMemberID, userName) {
}; };
Namecard.favoriteUserChange = function (shopMemberID, star) { Namecard.favoriteUserChange = function (shopMemberID, star) {
if ($(star).hasClass("active")) { const div = $(star);
Namecard.removeFavoriteUser(shopMemberID); if (div.hasClass("sp-circle")) {
} else if ($(star).hasClass("disable")) { return;
Namecard.insertFavoriteUser(shopMemberID);
} }
div.removeClass("star");
div.addClass("sp-circle");
setTimeout(() => {
if (div.hasClass("active")) {
Namecard.removeFavoriteUser(shopMemberID, div);
} else if (div.hasClass("disable")) {
Namecard.insertFavoriteUser(shopMemberID, div);
}
div.removeClass("sp-circle");
div.addClass("star");
if (typeof Contact != "undefined") {
Contact.reloadFavoriteList();
}
if (div.hasClass("active")) {
window.scroll(0, window.scrollY + $(".my_info_sell").height());
} else if (div.hasClass("disable")) {
window.scroll(0, window.scrollY - $(".my_info_sell").height());
}
}, 0);
}; };
Namecard.removeFavoriteUser = function (shopMemberID) { Namecard.removeFavoriteUser = function (shopMemberID, div) {
Common.showLoadingIndicator();
$("#userNameCard").modal("hide");
$("#myNameCard").modal("hide");
const result = NativeBridgeDataSource.removeFavoriteUser(shopMemberID); const result = NativeBridgeDataSource.removeFavoriteUser(shopMemberID);
if (result) { div.removeClass(result ? "active" : "disable");
$(".shopmember_" + shopMemberID).removeClass("active"); div.addClass(result ? "disable" : "active");
$(".shopmember_" + shopMemberID).addClass("disable");
} else {
$(".shopmember_" + shopMemberID).addClass("active");
$(".shopmember_" + shopMemberID).removeClass("disable");
}
Common.dismissLoadingIndicator();
}; };
Namecard.insertFavoriteUser = function (shopMemberID) { Namecard.insertFavoriteUser = function (shopMemberID, div) {
$("#userNameCard").modal("hide");
$("#myNameCard").modal("hide");
const result = NativeBridgeDataSource.addFavoriteUser(shopMemberID); const result = NativeBridgeDataSource.addFavoriteUser(shopMemberID);
if (result) { div.removeClass(result ? "disable" : "active");
$(".shopmember_" + shopMemberID).removeClass("disable"); div.addClass(result ? "active" : "disable");
$(".shopmember_" + shopMemberID).addClass("active");
} else {
$(".shopmember_" + shopMemberID).addClass("disable");
$(".shopmember_" + shopMemberID).removeClass("active");
}
Common.dismissLoadingIndicator();
}; };
Namecard.refreshForOnline = function () { Namecard.refreshForOnline = function () {
...@@ -109,11 +113,12 @@ Namecard.refreshForOffline = function () { ...@@ -109,11 +113,12 @@ Namecard.refreshForOffline = function () {
Namecard.moveContactPage = function (paramGroupID) { Namecard.moveContactPage = function (paramGroupID) {
const groupID = paramGroupID; const groupID = paramGroupID;
if (window.location.pathname.includes("chat_room") || if (
window.location.pathname.includes("archive_detail")) window.location.pathname.includes("chat_room") ||
{ window.location.pathname.includes("archive_detail")
) {
if (groupID == "") return; if (groupID == "") return;
NativeBridgeDelegate.setToMoveGroupId(groupID); NativeBridgeDelegate.setToMoveGroupId(groupID);
window.location.href = "contact.html"; window.location.href = "contact.html";
} }
} };
<!-- TODO: peacekim:: this file is not using-->
<div class="modal fade profile_modal" id="profileModal1" tabindex="-1" role="dialog" aria-labelledby="profileModal1" <div class="modal fade profile_modal" id="profileModal1" tabindex="-1" role="dialog" aria-labelledby="profileModal1"
aria-hidden="true"> aria-hidden="true">
<div class="modal-dialog modal-dialog-centered" role="document"> <div class="modal-dialog modal-dialog-centered" role="document">
......
...@@ -19,21 +19,19 @@ ...@@ -19,21 +19,19 @@
</div> </div>
<div class="modal-footer border-0 justify-content-center"> <div class="modal-footer border-0 justify-content-center">
{{#isFavorite}} {{#isFavorite}}
<button type="button" class="border-0 bg_navy" <button type="button" class="border-0 bg_navy" id="favoriteButton">
onclick="CollaborationUI.removeFavoriteUserInCollaboration({{shopMemberId}})" id="favoriteButton">
<div class="d-flex flex-column"> <div class="d-flex flex-column">
<span class="star active shopmember_{{shopMemberId}}" <span class="star active shopmember_{{shopMemberId}}"
onclick="CHAT_UI.favoriteUserChange('{{shopMemberId}}',this)"></span> onclick="CollaborationUI.removeFavoriteUserInCollaboration({{shopMemberId}})"></span>
<span>お気に入り解除</span> <span>お気に入り解除</span>
</div> </div>
</button> </button>
{{/isFavorite}} {{/isFavorite}}
{{^isFavorite}} {{^isFavorite}}
<button type="button" class="border-0 bg_navy" <button type="button" class="border-0 bg_navy" id="favoriteButton">
onclick="CollaborationUI.insertFavoriteUserInCollaboration({{shopMemberId}})" id="favoriteButton">
<div class="d-flex flex-column"> <div class="d-flex flex-column">
<span class="star disable shopmember_{{shopMemberId}}" <span class="star disable shopmember_{{shopMemberId}}"
onclick="Namecard.favoriteUserChange('{{shopMemberId}}',this)"></span> onclick="CollaborationUI.insertFavoriteUserInCollaboration({{shopMemberId}})"></span>
<span>お気に入り登録</span> <span>お気に入り登録</span>
</div> </div>
</button> </button>
......
{{#userList}} {{#userList}}
<div class="user_item"> <div class="user_item">
<a href="javascript:return false;" onclick="Namecard.makeNameCard({{shopMemberId}})"> <a href="#" onclick="Namecard.makeNameCard({{shopMemberId}})">
<div class="d-flex flex-column"> <div class="d-flex flex-column">
<div class="img_wrap"> <div class="img_wrap">
<img src="{{profileUrl}}" onError="this.src='./img/noImage.png'"> <img src="{{profileUrl}}" onError="this.src='./img/noImage.png'">
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<ul class="p-0 chat_make_room_list"> <ul class="p-0 chat_make_room_list">
{{#groupUserList}} {{#groupUserList}}
<li class="d-flex align-items-center"> <li class="d-flex align-items-center">
<a href="javascript:return false;" onclick="Namecard.makeNameCard({{shopMemberId}})" style="width: 100%;"> <a href="#" onclick="Namecard.makeNameCard({{shopMemberId}})" style="width: 100%;">
<div class="chat_item d-flex flex-row align-items-center"> <div class="chat_item d-flex flex-row align-items-center">
<div class="chat_item_l"> <div class="chat_item_l">
<div class="thumbnail"> <div class="thumbnail">
...@@ -21,10 +21,10 @@ ...@@ -21,10 +21,10 @@
<div class="chat_item_r"> <div class="chat_item_r">
<div class="d-flex flex-column"> <div class="d-flex flex-column">
{{#isFavorite}} {{#isFavorite}}
<span class="star active shopmember_{{shopMemberId}}" onclick="Namecard.favoriteUserChange({{shopMemberId}},this)"></span> <span class="star active shopmember_{{shopMemberId}}" onclick="Namecard.favoriteUserChange({{shopMemberId}}, this)"></span>
{{/isFavorite}} {{/isFavorite}}
{{^isFavorite}} {{^isFavorite}}
<span class="star disable shopmember_{{shopMemberId}}" onclick="Namecard.favoriteUserChange({{shopMemberId}},this)"></span> <span class="star disable shopmember_{{shopMemberId}}" onclick="Namecard.favoriteUserChange({{shopMemberId}}, this)"></span>
{{/isFavorite}} {{/isFavorite}}
</div> </div>
</div> </div>
......
<ul class="p-0 chat_make_room_list" style="margin-top: 0px !important;border-top: none !important;"> <ul class="p-0" style="margin-top: 0px !important;border-top: none !important;">
{{#userList}} {{#userList}}
<li class="d-flex align-items-center"> <li class="d-flex align-items-center userCell">
<a href="javascript:return false;" onclick="Namecard.makeNameCard({{shopMemberId}})" style="width: 100%;"> <a href="#" onclick="Namecard.makeNameCard({{shopMemberId}})" style="width: 100%;">
<div class="chat_item d-flex flex-row align-items-center"> <div class="chat_item d-flex flex-row align-items-center">
<div class="chat_item_l"> <div class="chat_item_l">
<div class="thumbnail"> <div class="thumbnail">
...@@ -20,10 +20,10 @@ ...@@ -20,10 +20,10 @@
<div class="chat_item_r"> <div class="chat_item_r">
<div class="d-flex flex-column"> <div class="d-flex flex-column">
{{#isFavorite}} {{#isFavorite}}
<span class="star active shopmember_{{shopMemberId}}" onclick="Namecard.favoriteUserChange({{shopMemberId}},this)"></span> <span class="star active shopmember_{{shopMemberId}}" onclick="Namecard.favoriteUserChange({{shopMemberId}}, this)"></span>
{{/isFavorite}} {{/isFavorite}}
{{^isFavorite}} {{^isFavorite}}
<span class="star disable shopmember_{{shopMemberId}}" onclick="Namecard.favoriteUserChange({{shopMemberId}},this)"></span> <span class="star disable shopmember_{{shopMemberId}}" onclick="Namecard.favoriteUserChange({{shopMemberId}}, this)"></span>
{{/isFavorite}} {{/isFavorite}}
</div> </div>
</div> </div>
......
...@@ -18,24 +18,20 @@ ...@@ -18,24 +18,20 @@
{{/groupPathList}} {{/groupPathList}}
</div> </div>
<div class="modal-footer border-0 justify-content-center"> <div class="modal-footer border-0 justify-content-center">
{{#isFavorite}} <button type="button" class="border-0" id="favoriteButton">
<button type="button" class="border-0" onclick="Namecard.removeFavoriteUser({{shopMemberId}})"
id="favoriteButton">
<div class="d-flex flex-column"> <div class="d-flex flex-column">
<span class="star active shopmember_{{shopMemberId}}" onclick="Namecard.favoriteUserChange('{{shopMemberId}}', this)"></span> {{#isFavorite}}
<span class="star active shopmember_{{shopMemberId}}"
onclick="Namecard.favoriteUserChange({{shopMemberId}}, this)"></span>
<span>お気に入り解除</span> <span>お気に入り解除</span>
</div> {{/isFavorite}}
</button> {{^isFavorite}}
{{/isFavorite}} <span class="star disable shopmember_{{shopMemberId}}"
{{^isFavorite}} onclick="Namecard.favoriteUserChange({{shopMemberId}}, this)"></span>
<button type="button" class="border-0" onclick="Namecard.insertFavoriteUser({{shopMemberId}})"
id="favoriteButton">
<div class="d-flex flex-column">
<span class="star disable shopmember_{{shopMemberId}}" onclick="Namecard.favoriteUserChange('{{shopMemberId}}', this)"></span>
<span>お気に入り登録</span> <span>お気に入り登録</span>
{{/isFavorite}}
</div> </div>
</button> </button>
{{/isFavorite}}
<button type="button" class="border-0" onclick="Namecard.startVoice('{{shopMemberId}}','{{name}}');"> <button type="button" class="border-0" onclick="Namecard.startVoice('{{shopMemberId}}','{{name}}');">
<div class="d-flex flex-column"> <div class="d-flex flex-column">
<div class="img_wrap"> <div class="img_wrap">
......
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