mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
fix new char highlight, group drawers autoOpen logic
This commit is contained in:
@ -4248,27 +4248,40 @@ function select_rm_info(type, charId, previousCharId = null) {
|
|||||||
getCharacters();
|
getCharacters();
|
||||||
selectRightMenuWithAnimation('rm_characters_block');
|
selectRightMenuWithAnimation('rm_characters_block');
|
||||||
|
|
||||||
if (type === 'char_import' || type === 'char_create') {
|
setTimeout(function () {
|
||||||
|
if (type === 'char_import' || type === 'char_create') {
|
||||||
|
const element = $(`#rm_characters_block [title="${charId}"]`).parent().get(0);
|
||||||
|
console.log(element);
|
||||||
|
element.scrollIntoView({ behavior: 'smooth', block: 'start' });
|
||||||
|
|
||||||
const element = $(`#rm_characters_block [title="${charId}"]`).get(0);
|
try {
|
||||||
element.scrollIntoView({ behavior: 'smooth', block: 'end' });
|
if (element !== undefined || element !== null) {
|
||||||
|
$(element).addClass('flash animated');
|
||||||
$(`#rm_characters_block [title="${charId}"]`).parent().addClass('flash animated');
|
setTimeout(function () {
|
||||||
setTimeout(function () {
|
$(element).removeClass('flash animated');
|
||||||
$(`#rm_characters_block [title="${charId}"]`).parent().removeClass('flash animated');
|
}, 5000);
|
||||||
}, 5000);
|
} else { console.log('didnt find the element'); }
|
||||||
}
|
} catch (e) {
|
||||||
|
console.error(e);
|
||||||
if (type === 'group_create') {
|
}
|
||||||
//for groups, ${charId} = data.id from group-chats.js createGroup()
|
}
|
||||||
const element = $(`#rm_characters_block [grid="${charId}"]`).get(0);
|
|
||||||
element.scrollIntoView({ behavior: 'smooth', block: 'end' });
|
|
||||||
$(`#rm_characters_block [grid="${charId}"]`).addClass('flash animated');
|
|
||||||
setTimeout(function () {
|
|
||||||
$(`#rm_characters_block [grid="${charId}"]`).removeClass('flash animated');
|
|
||||||
}, 5000);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
if (type === 'group_create') {
|
||||||
|
//for groups, ${charId} = data.id from group-chats.js createGroup()
|
||||||
|
const element = $(`#rm_characters_block [grid="${charId}"]`).get(0);
|
||||||
|
element.scrollIntoView({ behavior: 'smooth', block: 'start' });
|
||||||
|
try {
|
||||||
|
if (element !== undefined || element !== null) {
|
||||||
|
$(element).addClass('flash animated');
|
||||||
|
setTimeout(function () {
|
||||||
|
$(element).removeClass('flash animated');
|
||||||
|
}, 5000);
|
||||||
|
} else { console.log('didnt find the element'); }
|
||||||
|
} catch (e) {
|
||||||
|
console.error(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}, 100);
|
||||||
setRightTabSelectedClass();
|
setRightTabSelectedClass();
|
||||||
|
|
||||||
if (previousCharId) {
|
if (previousCharId) {
|
||||||
@ -5106,6 +5119,12 @@ function importCharacter(file) {
|
|||||||
$(document).ready(function () {
|
$(document).ready(function () {
|
||||||
//////////INPUT BAR FOCUS-KEEPING LOGIC/////////////
|
//////////INPUT BAR FOCUS-KEEPING LOGIC/////////////
|
||||||
|
|
||||||
|
setTimeout(function () {
|
||||||
|
$("#groupControlsToggle").trigger('click');
|
||||||
|
$("#groupCurrentMemberListToggle .inline-drawer-icon").trigger('click');
|
||||||
|
}, 200);
|
||||||
|
|
||||||
|
|
||||||
$("#rm_print_characters_block").on('scroll',
|
$("#rm_print_characters_block").on('scroll',
|
||||||
debounce(updateVisibleDivs, 5));
|
debounce(updateVisibleDivs, 5));
|
||||||
|
|
||||||
|
@ -972,6 +972,9 @@ function select_group_chats(groupId, skipAnimation) {
|
|||||||
$("#rm_group_scenario").show();
|
$("#rm_group_scenario").show();
|
||||||
} else {
|
} else {
|
||||||
$("#rm_group_submit").show();
|
$("#rm_group_submit").show();
|
||||||
|
if ($("#groupAddMemberListToggle .inline-drawer-content").css('display') !== 'block') {
|
||||||
|
$("#groupAddMemberListToggle").trigger('click');
|
||||||
|
}
|
||||||
$("#rm_group_delete").hide();
|
$("#rm_group_delete").hide();
|
||||||
$("#rm_group_scenario").hide();
|
$("#rm_group_scenario").hide();
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user