mirror of
https://github.com/HeyPuter/puter.git
synced 2026-01-07 05:30:31 -06:00
When a window is being dragged don't activate toolbar (duh!)
This commit is contained in:
@@ -1587,6 +1587,10 @@ async function UIDesktop(options) {
|
||||
|
||||
// hovering over a hidden toolbar will show it
|
||||
$(document).on('mouseenter', '.toolbar-hidden', function () {
|
||||
// if a window is being dragged, don't show the toolbar
|
||||
if(window.a_window_is_being_dragged)
|
||||
return;
|
||||
|
||||
if(window.is_fullpage_mode)
|
||||
$('.window-app-iframe').css('pointer-events', 'none');
|
||||
|
||||
@@ -1600,6 +1604,10 @@ async function UIDesktop(options) {
|
||||
|
||||
// hovering over a visible toolbar will show it and cancel hiding
|
||||
$(document).on('mouseenter', '.toolbar:not(.toolbar-hidden)', function () {
|
||||
// if a window is being dragged, don't show the toolbar
|
||||
if(window.a_window_is_being_dragged)
|
||||
return;
|
||||
|
||||
// Clear any pending hide timeout when entering toolbar
|
||||
if (toolbarHideTimeout) {
|
||||
clearTimeout(toolbarHideTimeout);
|
||||
|
||||
@@ -1636,6 +1636,7 @@ async function UIWindow(options) {
|
||||
|
||||
$(el_window).draggable({
|
||||
start: function(e, ui){
|
||||
window.a_window_is_being_dragged = true;
|
||||
// if window is snapped, unsnap it and reset its position to where it was before snapping
|
||||
if(options.is_resizable && window_is_snapped){
|
||||
window_is_snapped = false;
|
||||
@@ -1798,6 +1799,7 @@ async function UIWindow(options) {
|
||||
}
|
||||
},
|
||||
stop: function () {
|
||||
window.a_window_is_being_dragged = false;
|
||||
let window_will_snap = false;
|
||||
$( el_window ).draggable( "option", "cursorAt", false );
|
||||
|
||||
|
||||
Reference in New Issue
Block a user