Commit 5bfd24ad by Lee Munkyeong

Merge branch 'bugFix/#467_dose_not_show_profile_on_offline' into 'release_sp3'

Bug fix/#467 dose not show profile on offline

See merge request !42
parents 4dbca001 c98d1c66
...@@ -158,6 +158,10 @@ main { ...@@ -158,6 +158,10 @@ main {
padding-right: 1rem; padding-right: 1rem;
margin-top: 1rem; margin-top: 1rem;
} }
.disabled {
background: darkgray !important;
}
.profile_modal .modal-header { display: table; } .profile_modal .modal-header { display: table; }
.profile_modal .modal-header,.profile_modal .modal-body { padding-bottom: 0; } .profile_modal .modal-header,.profile_modal .modal-body { padding-bottom: 0; }
.profile_modal .modal-footer button { width: 33%; padding: 5px; } .profile_modal .modal-footer button { width: 33%; padding: 5px; }
......
...@@ -1132,6 +1132,7 @@ CHAT_UI.joinRoom = function(roomId,roomName) { ...@@ -1132,6 +1132,7 @@ CHAT_UI.joinRoom = function(roomId,roomName) {
CHAT_UI.loadMessages = function(roomId, roomName) { CHAT_UI.loadMessages = function(roomId, roomName) {
if (IS_ONLINE == 'true') { if (IS_ONLINE == 'true') {
CHAT_UI.refreshForOnline();
CHAT_SOCKET.connectSocket(); CHAT_SOCKET.connectSocket();
if (typeof(android) != "undefined") { if (typeof(android) != "undefined") {
android.updateMessages(roomId); android.updateMessages(roomId);
...@@ -1141,6 +1142,8 @@ CHAT_UI.loadMessages = function(roomId, roomName) { ...@@ -1141,6 +1142,8 @@ CHAT_UI.loadMessages = function(roomId, roomName) {
socket.emit('exitRoom',roomId); socket.emit('exitRoom',roomId);
socket.emit('joinRoom', roomId, roomName, function() { socket.emit('joinRoom', roomId, roomName, function() {
}); });
} else {
CHAT_UI.refreshForOffline();
} }
var roomType = android.getRoomType(); var roomType = android.getRoomType();
if (roomType == chatRoomType.DM) { if (roomType == chatRoomType.DM) {
...@@ -1344,12 +1347,19 @@ CHAT_UI.removeFavoriteUser = function(shopMemberId) { ...@@ -1344,12 +1347,19 @@ CHAT_UI.removeFavoriteUser = function(shopMemberId) {
$('#userNameCard').modal('hide'); $('#userNameCard').modal('hide');
$('#myNameCard').modal('hide'); $('#myNameCard').modal('hide');
if (typeof(android) != "undefined") { if (typeof(android) != "undefined") {
android.removeFavoriteUser(shopMemberId); var result = android.removeFavoriteUser(shopMemberId);
if (!result) {
$('.shopmember_'+shopMemberId).addClass('active');
$('.shopmember_'+shopMemberId).removeClass('disable');
} else { } else {
webkit.messageHandlers.removeFavoriteUser.postMessage({shopMemberId}); $('.shopmember_'+shopMemberId).removeClass('active');
$('.shopmember_'+shopMemberId).addClass('disable');
} }
} else {
webkit.messageHandlers.removeFavoriteUser.postMessage({shopMemberId});
$('.shopmember_'+shopMemberId).removeClass('active'); $('.shopmember_'+shopMemberId).removeClass('active');
$('.shopmember_'+shopMemberId).addClass('disable'); $('.shopmember_'+shopMemberId).addClass('disable');
}
CHAT_UI.dismissLoadingIndicator(); CHAT_UI.dismissLoadingIndicator();
}; };
...@@ -1571,7 +1581,11 @@ CHAT_UI.refreshArchiveScreen = function() { ...@@ -1571,7 +1581,11 @@ CHAT_UI.refreshArchiveScreen = function() {
// ローカルDBのデータを表示 // ローカルDBのデータを表示
var archiveList = CHAT_DB.getArchiveList(); var archiveList = CHAT_DB.getArchiveList();
archiveList.forEach(function(archive) { if (typeof archiveList == 'undefined') {
CHAT_UI.dismissLoadingIndicator();
return;
}
carchiveList.forEach(function(archive) {
var typeImage = ""; var typeImage = "";
switch(archive.archiveType) { switch(archive.archiveType) {
case 0: // 画像 case 0: // 画像
...@@ -2159,3 +2173,29 @@ CHAT_UI.refreshMyGroupForAddUser = function() { ...@@ -2159,3 +2173,29 @@ CHAT_UI.refreshMyGroupForAddUser = function() {
$('#myGroupListForMakeRoom').append(obj); $('#myGroupListForMakeRoom').append(obj);
}) })
} }
CHAT_UI.refreshForOnline = function() {
IS_ONLINE = 'true';
$('.craeteRoomButton').show();
$('#messageSend').removeClass('disabled');
$('#messageSend').attr('disabled', false);
$('#favoriteButton').attr('disabled', false);
$('#roomMenu').show();
$('.attach_file').show();
if (typeof $('#roomTitle').val() != 'undefined') {
CHAT_SOCKET.connectSocket();
socket.emit('exitRoom',CHAT.globalLoginParameter.roomId);
socket.emit('joinRoom', CHAT.globalLoginParameter.roomId, CHAT.globalLoginParameter.roomName, function() {
});
}
}
CHAT_UI.refreshForOffline = function() {
IS_ONLINE = 'false';
$('.craeteRoomButton').hide();
$('#messageSend').addClass('disabled');
$('#messageSend').attr('disabled', true);
$('#favoriteButton').attr('disabled', true);
$('#roomMenu').hide();
$('.attach_file').hide();
}
\ No newline at end of file
...@@ -28,8 +28,12 @@ CHAT.getProfileImgUrl = function(path) { ...@@ -28,8 +28,12 @@ CHAT.getProfileImgUrl = function(path) {
if (path == undefined || path == "") { if (path == undefined || path == "") {
return ASSET_PATH + 'img/noImage.png'; return ASSET_PATH + 'img/noImage.png';
} else { } else {
if (path.includes('/mnt')) {
var userInfo = path.split("/").reverse(); var userInfo = path.split("/").reverse();
return CMS_SERVER_URL + '/chatapi/user?profileFileName=' + userInfo[0] + '&profileGetLoginId=' + userInfo[1] + '&sid=' + CHAT.globalLoginParameter.sid + '&cmd=12'; return CMS_SERVER_URL + '/chatapi/user?profileFileName=' + userInfo[0] + '&profileGetLoginId=' + userInfo[1] + '&sid=' + CHAT.globalLoginParameter.sid + '&cmd=12';
} else {
return path;
}
} }
} }
......
...@@ -21,17 +21,6 @@ $(function() { ...@@ -21,17 +21,6 @@ $(function() {
}, 1000); }, 1000);
}); });
// お気に入りボタン押下イベント
$(".star").click(function () {
if ($(this).hasClass("active")) {
$(this).removeClass("active");
$(this).addClass("disable");
} else {
$(this).removeClass("disable");
$(this).addClass("active");
}
});
// 共通検索フォーム キャンセルボタン表示 // 共通検索フォーム キャンセルボタン表示
$('.search_form input[type="search"]').click(function () { $('.search_form input[type="search"]').click(function () {
$(this).addClass("focus"); $(this).addClass("focus");
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
</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" onclick="CHAT_UI.removeFavoriteUser({{shopMemberId}})"> <button type="button" class="border-0 bg_navy" onclick="CHAT_UI.removeFavoriteUser({{shopMemberId}})" id="favoriteButton">
<div class="d-flex flex-column"> <div class="d-flex flex-column">
<div class="img_wrap"> <div class="img_wrap">
<img src="icon/icon_profile_favorite.png" alt="お気に入り"> <img src="icon/icon_profile_favorite.png" alt="お気に入り">
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
</button> </button>
{{/isFavorite}} {{/isFavorite}}
{{^isFavorite}} {{^isFavorite}}
<button type="button" class="border-0 bg_navy" onclick="CHAT_UI.insertFavoriteUser({{shopMemberId}})"> <button type="button" class="border-0 bg_navy" onclick="CHAT_UI.insertFavoriteUser({{shopMemberId}})" id="favoriteButton">
<div class="d-flex flex-column"> <div class="d-flex flex-column">
<div class="img_wrap"> <div class="img_wrap">
<img src="icon/icon_profile_favorite_white.png" alt="お気に入り"> <img src="icon/icon_profile_favorite_white.png" alt="お気に入り">
......
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