Commit 485b0deb by Kim Peace

Fixed for contact and namecard for favorite

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