mirror of
https://github.com/JannisX11/blockbench.git
synced 2025-02-17 16:20:13 +08:00
Fix issue with copying from unfocused text input
Keyframes can now be copied while preview is focused
This commit is contained in:
parent
e013ea4dff
commit
27b399621d
@ -16,7 +16,7 @@ const Clipbench = {
|
||||
let p = Prop.active_panel;
|
||||
let text;
|
||||
if (!check) {
|
||||
text = window.getSelection()+'';
|
||||
text = getFocusedTextInput() && window.getSelection()+'';
|
||||
}
|
||||
if (text) {
|
||||
return Clipbench.types.text;
|
||||
@ -30,7 +30,7 @@ const Clipbench = {
|
||||
if (display_mode) {
|
||||
return Clipbench.types.display_slot
|
||||
}
|
||||
if (Animator.open && Timeline.animators.length && (Timeline.selected.length || mode === 2) && ['keyframe', 'timeline'].includes(p)) {
|
||||
if (Animator.open && Timeline.animators.length && (Timeline.selected.length || mode === 2) && ['keyframe', 'timeline', 'preview'].includes(p)) {
|
||||
return Clipbench.types.keyframe
|
||||
}
|
||||
if ((p == 'uv' || p == 'preview') && Modes.edit) {
|
||||
|
@ -347,6 +347,10 @@ setInterval(() => {
|
||||
}
|
||||
}, 100)
|
||||
|
||||
function getFocusedTextInput() {
|
||||
return $('input[type="text"]:focus, input[type="number"]:focus, *[contenteditable="true"]:focus, textarea:focus').get(0)
|
||||
}
|
||||
|
||||
$(document).on('keydown mousedown', function(e) {
|
||||
if (Keybinds.recording || e.which < 4) return;
|
||||
//Shift
|
||||
@ -358,7 +362,7 @@ $(document).on('keydown mousedown', function(e) {
|
||||
}
|
||||
|
||||
var used = false;
|
||||
var input_focus = $('input[type="text"]:focus, input[type="number"]:focus, *[contenteditable="true"]:focus, textarea:focus').get(0)
|
||||
var input_focus = getFocusedTextInput()
|
||||
|
||||
if (input_focus) {
|
||||
//User Editing Anything
|
||||
|
Loading…
Reference in New Issue
Block a user