add some missing tooltips

isekai-main
Barış Soner Uşaklı 1 year ago
parent 31305d64ba
commit 26d06d9bb0

@ -43,7 +43,7 @@ define('forum/chats', [
}); });
Chats.init = function () { Chats.init = function () {
$('.chats-full [data-bs-toggle="tooltip"]').tooltip(); $('.chats-full [data-bs-toggle="tooltip"]').tooltip({ trigger: 'hover', container: '#content' });
socket.emit('modules.chats.enterPublic', ajaxify.data.publicRooms.map(r => r.roomId)); socket.emit('modules.chats.enterPublic', ajaxify.data.publicRooms.map(r => r.roomId));
const env = utils.findBootstrapEnvironment(); const env = utils.findBootstrapEnvironment();
chatNavWrapper = $('[component="chat/nav-wrapper"]'); chatNavWrapper = $('[component="chat/nav-wrapper"]');
@ -104,7 +104,7 @@ define('forum/chats', [
Chats.addNotificationSettingHandler(roomId, mainWrapper); Chats.addNotificationSettingHandler(roomId, mainWrapper);
messageSearch.init(roomId, mainWrapper); messageSearch.init(roomId, mainWrapper);
Chats.addPublicRoomSortHandler(); Chats.addPublicRoomSortHandler();
Chats.addTooltipHandler(); Chats.addTooltipHandler(mainWrapper);
}; };
Chats.addPublicRoomSortHandler = function () { Chats.addPublicRoomSortHandler = function () {
@ -128,8 +128,12 @@ define('forum/chats', [
} }
}; };
Chats.addTooltipHandler = function () { Chats.addTooltipHandler = function (containerEl) {
$('[data-manual-tooltip]').tooltip({ if (utils.isMobile()) {
return;
}
containerEl.find('[data-manual-tooltip]').tooltip({
trigger: 'manual', trigger: 'manual',
animation: false, animation: false,
placement: 'bottom', placement: 'bottom',
@ -142,6 +146,13 @@ define('forum/chats', [
}).on('click mouseleave', function () { }).on('click mouseleave', function () {
$(this).tooltip('hide'); $(this).tooltip('hide');
}); });
containerEl.tooltip({
selector: '[component="chat/message/controls"] button',
placement: 'top',
container: '#content',
animation: false,
});
}; };
Chats.addNotificationSettingHandler = function (roomId, containerEl) { Chats.addNotificationSettingHandler = function (roomId, containerEl) {
@ -524,7 +535,7 @@ define('forum/chats', [
ajaxify.data = { ...ajaxify.data, ...payload, roomId: roomId }; ajaxify.data = { ...ajaxify.data, ...payload, roomId: roomId };
ajaxify.updateTitle(ajaxify.data.title); ajaxify.updateTitle(ajaxify.data.title);
$('body').toggleClass('chat-loaded', !!roomId); $('body').toggleClass('chat-loaded', !!roomId);
mainWrapper.find('[data-bs-toggle="tooltip"]').tooltip(); mainWrapper.find('[data-bs-toggle="tooltip"]').tooltip({ trigger: 'hover', container: '#content' });
Chats.setActive(roomId); Chats.setActive(roomId);
Chats.addEventListeners(); Chats.addEventListeners();
hooks.fire('action:chat.loaded', $('.chats-full')); hooks.fire('action:chat.loaded', $('.chats-full'));

@ -280,6 +280,7 @@ define('chat', [
chatModal.css('position', 'fixed'); chatModal.css('position', 'fixed');
chatModal.appendTo($('body')); chatModal.appendTo($('body'));
chatModal.find('.timeago').timeago(); chatModal.find('.timeago').timeago();
chatModal.find('[data-bs-toggle="tooltip"]').tooltip({ trigger: 'hover', container: '#content' });
ChatsMessages.wrapImagesInLinks(chatModal.find('[component="chat/messages"] .chat-content')); ChatsMessages.wrapImagesInLinks(chatModal.find('[component="chat/messages"] .chat-content'));
module.center(chatModal); module.center(chatModal);
@ -370,7 +371,7 @@ define('chat', [
Chats.addCharactersLeftHandler(chatModal); Chats.addCharactersLeftHandler(chatModal);
Chats.addTextareaResizeHandler(chatModal); Chats.addTextareaResizeHandler(chatModal);
Chats.addIPHandler(chatModal); Chats.addIPHandler(chatModal);
Chats.addTooltipHandler(chatModal);
Chats.addUploadHandler({ Chats.addUploadHandler({
dragDropAreaEl: chatModal.find('.modal-content'), dragDropAreaEl: chatModal.find('.modal-content'),
pasteEl: chatModal, pasteEl: chatModal,

Loading…
Cancel
Save