change naming convention for debounce to match others. (snake case)

This commit is contained in:
JohnBoulanger
2025-11-20 16:42:21 -05:00
parent 8fe3e2fff6
commit aaedee0dfa
2 changed files with 7 additions and 7 deletions

2
package-lock.json generated
View File

@@ -20068,7 +20068,7 @@
},
"src/puter-js": {
"name": "@heyputer/puter.js",
"version": "2.1.2",
"version": "2.1.6",
"license": "Apache-2.0",
"dependencies": {
"@heyputer/kv.js": "^0.2.1",

View File

@@ -1548,21 +1548,21 @@ async function UIDesktop(options) {
};
// debounce timer to prevent toolbar showing immediately after drag ends
window.dragReleaseDebounceTimer = null;
window.drag_release_debounce_timer = null;
const DRAG_RELEASE_DEBOUNCE_MS = 300;
// track when drag operations end to enable debounce
$(document).on('dragend', function() {
window.dragReleaseDebounceTimer = setTimeout(() => {
window.dragReleaseDebounceTimer = null;
window.drag_release_debounce_timer = setTimeout(() => {
window.drag_release_debounce_timer = null;
}, DRAG_RELEASE_DEBOUNCE_MS);
});
// also debounce when mouseup occurs while in drag state
$(document).on('mouseup', function() {
if (window.a_window_is_being_dragged || window.an_item_is_being_dragged) {
window.dragReleaseDebounceTimer = setTimeout(() => {
window.dragReleaseDebounceTimer = null;
window.drag_release_debounce_timer = setTimeout(() => {
window.drag_release_debounce_timer = null;
}, DRAG_RELEASE_DEBOUNCE_MS);
}
});
@@ -1570,7 +1570,7 @@ async function UIDesktop(options) {
// hovering over a hidden toolbar will show it
$(document).on('mouseenter', '.toolbar-hidden', function () {
// if a window is being dragged or currently in drag release debounce period, don't show the toolbar
if(window.a_window_is_being_dragged || window.dragReleaseDebounceTimer !== null)
if(window.a_window_is_being_dragged || window.drag_release_debounce_timer !== null)
return;
// if selectable is active , don't show the toolbar