mirror of
https://github.com/KoboldAI/KoboldAI-Client.git
synced 2025-06-05 21:59:24 +02:00
Fix for non-firefox drag and drop problems
Fix for WI box sizes auto-shrinking on click out
This commit is contained in:
@@ -62,6 +62,7 @@ var control_held = false;
|
|||||||
var actions_data = {};
|
var actions_data = {};
|
||||||
var setup_wi_toggles = [];
|
var setup_wi_toggles = [];
|
||||||
var scroll_trigger_element = undefined; //undefined means not currently set. If set to null, it's disabled.
|
var scroll_trigger_element = undefined; //undefined means not currently set. If set to null, it's disabled.
|
||||||
|
var drag_id = null;
|
||||||
const on_colab = $el("#on_colab").textContent == "true";
|
const on_colab = $el("#on_colab").textContent == "true";
|
||||||
|
|
||||||
// name, desc, icon, func
|
// name, desc, icon, func
|
||||||
@@ -3190,8 +3191,7 @@ function unhide_wi_folder(folder) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function dragStart(e) {
|
function dragStart(e) {
|
||||||
e.dataTransfer.setData('text/plain', e.target.id);
|
drag_id = e.target.id;
|
||||||
//console.log(e.target.id);
|
|
||||||
e.dataTransfer.dropEffect = "move";
|
e.dataTransfer.dropEffect = "move";
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
e.target.classList.add('hidden');
|
e.target.classList.add('hidden');
|
||||||
@@ -3242,7 +3242,7 @@ function drop(e) {
|
|||||||
element.classList.remove('drag-over');
|
element.classList.remove('drag-over');
|
||||||
|
|
||||||
// get the draggable element
|
// get the draggable element
|
||||||
const id = e.dataTransfer.getData('text/plain');
|
const id = drag_id;
|
||||||
const draggable = document.getElementById(id);
|
const draggable = document.getElementById(id);
|
||||||
//console.log(id);
|
//console.log(id);
|
||||||
dragged_id = draggable.id.split("_").slice(-1)[0];
|
dragged_id = draggable.id.split("_").slice(-1)[0];
|
||||||
@@ -3255,6 +3255,7 @@ function drop(e) {
|
|||||||
socket.emit("wi_set_folder", {'dragged_id': dragged_id, 'folder': drop_id});
|
socket.emit("wi_set_folder", {'dragged_id': dragged_id, 'folder': drop_id});
|
||||||
} else {
|
} else {
|
||||||
//insert the draggable element before the drop element
|
//insert the draggable element before the drop element
|
||||||
|
console.log(element);
|
||||||
element.parentElement.insertBefore(draggable, element);
|
element.parentElement.insertBefore(draggable, element);
|
||||||
draggable.classList.add("pulse");
|
draggable.classList.add("pulse");
|
||||||
|
|
||||||
@@ -3271,7 +3272,7 @@ function drop(e) {
|
|||||||
|
|
||||||
function dragend(e) {
|
function dragend(e) {
|
||||||
// get the draggable element
|
// get the draggable element
|
||||||
const id = e.dataTransfer.getData('text/plain');
|
const id = drag_id;
|
||||||
const draggable = document.getElementById(id);
|
const draggable = document.getElementById(id);
|
||||||
// display the draggable element
|
// display the draggable element
|
||||||
draggable.classList.remove('hidden');
|
draggable.classList.remove('hidden');
|
||||||
|
@@ -35,7 +35,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div id="world_info_basic_text_">
|
<div id="world_info_basic_text_">
|
||||||
Text:
|
Text:
|
||||||
<textarea id="world_info_entry_text_" class="world_info_text fullwidth" oninput="autoResize(this, 60)" onfocus="autoResize(this, 60)"></textarea>
|
<textarea id="world_info_entry_text_" class="world_info_text fullwidth" oninput="autoResize(this, 60)" onfocus="autoResize(this, 60)" onblur="this.style.height=60;"></textarea>
|
||||||
</div>
|
</div>
|
||||||
<div id="world_info_entry_w++_" class="hidden">
|
<div id="world_info_entry_w++_" class="hidden">
|
||||||
<input type=text placeholder="Type"/><input type=text placeholder="Name"/>
|
<input type=text placeholder="Type"/><input type=text placeholder="Name"/>
|
||||||
@@ -45,7 +45,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
Comment:
|
Comment:
|
||||||
<textarea rows=1 id="world_info_comment_" class="world_info_text fullwidth" oninput="autoResize(this, 60)" onfocus="autoResize(this, 60)"></textarea>
|
<textarea rows=1 id="world_info_comment_" class="world_info_text fullwidth" oninput="autoResize(this, 60)" onfocus="autoResize(this, 60)" onblur="this.style.height=60;"></textarea>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div id="empty_bias">
|
<div id="empty_bias">
|
||||||
|
Reference in New Issue
Block a user