mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Add event handlers for dynamically added neo-range-inputs
This commit is contained in:
@ -10745,15 +10745,17 @@ jQuery(async function () {
|
||||
var isManualInput = false;
|
||||
var valueBeforeManualInput;
|
||||
|
||||
$('.range-block-counter input, .neo-range-input').on('click', function () {
|
||||
$(document).on('input', '.range-block-counter input, .neo-range-input', function () {
|
||||
valueBeforeManualInput = $(this).val();
|
||||
console.log(valueBeforeManualInput);
|
||||
})
|
||||
.on('change', function (e) {
|
||||
});
|
||||
|
||||
$(document).on('change', '.range-block-counter input, .neo-range-input', function (e) {
|
||||
e.target.focus();
|
||||
e.target.dispatchEvent(new Event('keyup'));
|
||||
})
|
||||
.on('keydown', function (e) {
|
||||
e.target.dispatchEvent(new KeyboardEvent('keyup', { bubbles: true }));
|
||||
});
|
||||
|
||||
$(document).on('keydown', '.range-block-counter input, .neo-range-input', function (e) {
|
||||
const masterSelector = '#' + $(this).data('for');
|
||||
const masterElement = $(masterSelector);
|
||||
if (e.key === 'Enter') {
|
||||
@ -10775,14 +10777,16 @@ jQuery(async function () {
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
.on('keyup', function () {
|
||||
});
|
||||
|
||||
$(document).on('keyup', '.range-block-counter input, .neo-range-input', function () {
|
||||
valueBeforeManualInput = $(this).val();
|
||||
console.log(valueBeforeManualInput);
|
||||
isManualInput = true;
|
||||
})
|
||||
});
|
||||
|
||||
//trigger slider changes when user clicks away
|
||||
.on('mouseup blur', function () {
|
||||
$(document).on('mouseup blur', '.range-block-counter input, .neo-range-input', function () {
|
||||
const masterSelector = '#' + $(this).data('for');
|
||||
const masterElement = $(masterSelector);
|
||||
let manualInput = Number($(this).val());
|
||||
|
Reference in New Issue
Block a user