Commit 6f694ccd by Lee Munkyeong

コードレビュー対応。

parent 78f28fa1
......@@ -15,7 +15,7 @@ CHAT_DB.getRoomList = function(roomType) {
//ロカールDBからログインしたユーザのデータを取得する。
CHAT_DB.getMyInfo = function(input) {
var result = JSON.parse(android.getMyInfo());
CHAT.globalLoginParameter.shopMemberId = result.shopMemberId;
CHAT.globalLoginParameter.shopMemberId = result.shopMemberId;
if (CHAT_UTIL.isIOS()) {
//TODO IOS処理追加必要
} else if (CHAT_UTIL.isAndroid()) {
......
......@@ -45,7 +45,7 @@ function setSocketAction () {
CHAT_UI.dismissLoadingIndicator();
});
socket.on('disconnect', function (){
socket.on('disconnect', function() {
console.log('disconnect');
//socketが切断されたら黒画面で画面を更新する
$('.overlay').addClass('active undismissable');
......@@ -53,7 +53,7 @@ function setSocketAction () {
CHAT_UI.dismissLoadingIndicator();
});
socket.on('connect_error', function (){
socket.on('connect_error', function() {
console.log('connect_error');
CHAT_UI.dismissLoadingIndicator();
});
......@@ -171,7 +171,7 @@ function setSocketAction () {
// New Message
// #36170
socket.on('newMessage', function (message, roomId, roomName) {
socket.on('newMessage', function(message, roomId, roomName) {
let template = $('#message-template').html();
if (message.id === socket.id) {
// ユーザーが送信したメッセージの場合、自分のメッセージ様式を適用して表示する
......@@ -204,7 +204,7 @@ function setSocketAction () {
});
// Notification
socket.on('newNotification', function(keyword, event){
socket.on('newNotification', function(keyword, event) {
var notificationString = getLocalizedString(event, keyword)
$('#messageNotification').finish().text(notificationString).delay(500).slideDown().delay(1500).slideUp();
});
......@@ -280,13 +280,13 @@ function setSocketAction () {
// Update User List In Room
// サイドバーのユーザーリストアップデート。
socket.on('updateUserList', function(users, onlineUsers){
socket.on('updateUserList', function(users, onlineUsers) {
if (users.length > 0) {
$('#users').removeData();
$('#users').data(users);
} else {
const data = $('#users').data();
if (data && Object.keys(data).length > 0){
if (data && Object.keys(data).length > 0) {
users = Object.keys(data).map(function(key) {
return data[key];
});
......@@ -297,7 +297,7 @@ function setSocketAction () {
// ユーザーリストを入れる前にユーザー招待ボタンを入れてくれる。
let inviteString = getLocalizedString("inviteUsersButton")
ul.append($('<li/>').append(`<a>${inviteString} <i class='fa fa-user-plus'><i/></a>`).on('click', function(event){
ul.append($('<li/>').append(`<a>${inviteString} <i class='fa fa-user-plus'><i/></a>`).on('click', function(event) {
$('#dismiss').click();
// loadingIndicatorを表示
CHAT_UI.showLoadingIndicator();
......@@ -321,7 +321,7 @@ function setSocketAction () {
});
// Update Group List(Invite)
socket.on('refreshGroupList', function(groups, isInvite){
socket.on('refreshGroupList', function(groups, isInvite) {
$('#group_list').html('');
const template = $('#group-template').html();
if (groups.length === 0) {
......@@ -359,14 +359,14 @@ function setSocketAction () {
$('.titleRoomName').text(memberSelectTitle);
$('#newRoomName, .roomListIcon, .chatRoomIcon').hide();
$('#userSelectionConfirmBtn').show();
$("#userSelectionConfirmBtn").off().on('click', function(){
$("#userSelectionConfirmBtn").off().on('click', function() {
CHAT_UI.setConfirmButtonEvent(isInvite);
});
} else {
$('.titleRoomName').text(memberSelectTitle);
$('.roomListIcon, .chatRoomIcon, #newRoomName').hide();
$('#userSelectionConfirmBtn').show();
$("#userSelectionConfirmBtn").off().on('click', function(){
$("#userSelectionConfirmBtn").off().on('click', function() {
CHAT_UI.setConfirmButtonEvent(isInvite);
});
}
......@@ -394,7 +394,7 @@ function setSocketAction () {
// Update User List(Invite)
// #36170
socket.on('refreshUserListInGroup', function(users, groupId, isInvite){
socket.on('refreshUserListInGroup', function(users, groupId, isInvite) {
$('#user_list').html('');
const template = $('#user-template').html();
......@@ -415,7 +415,7 @@ function setSocketAction () {
});
// クリックするとactive クラスを与え、チェック表示を出させる。
let obj = $(jQuery.parseHTML(html)).on('click',function(){
let obj = $(jQuery.parseHTML(html)).on('click',function() {
if ($(this).find('.userCheckBox.active').length > 0) {
// remove
CHAT.globalSelectedUserList = CHAT.globalSelectedUserList.filter(function(element) {
......@@ -458,7 +458,7 @@ function setSocketAction () {
socket.emit('getGroupList', isInvite)
});
$("#userSelectionConfirmBtn").off().on('click', function(){
$("#userSelectionConfirmBtn").off().on('click', function() {
// loadingIndicatorを表示
CHAT_UI.showLoadingIndicator();
CHAT_UI.setConfirmButtonEvent(isInvite);
......@@ -475,7 +475,7 @@ function setSocketAction () {
/* Show Error Log */
/* ---------------------------------------------------------------------- */
socket.on('showServerError', function (message){
socket.on('showServerError', function(message) {
// #36174
// #36215
......@@ -501,7 +501,7 @@ function setSocketAction () {
});
CHAT_UI.dismissLoadingIndicator();
if (message == "Room not found"){
if (message == "Room not found") {
CHAT.saveRoomInfo();
}
});
......
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