diff --git a/src/gui/src/UI/UIDesktop.js b/src/gui/src/UI/UIDesktop.js index fa64e925..a4cd5c1a 100644 --- a/src/gui/src/UI/UIDesktop.js +++ b/src/gui/src/UI/UIDesktop.js @@ -273,6 +273,9 @@ async function UIDesktop(options) { * It is not necessary to query unreads separately. If this stops working, * then this event should be fixed rather than querying unreads separately. */ + // Ensure horizontal scroll na aaye + $('.desktop.item-container').css('overflow-x', 'hidden'); + window.__already_got_unreads = false; window.socket.on('notif.unreads', async ({ unreads }) => { if (window.__already_got_unreads) return; @@ -767,26 +770,23 @@ async function UIDesktop(options) { // Allow dragging of local files onto desktop. // -------------------------------------------------------- $(el_desktop).dragster({ - enter: function (dragsterEvent, event) { - $('.context-menu').remove(); - }, - leave: function (dragsterEvent, event) { - }, - drop: async function (dragsterEvent, event) { - const e = event.originalEvent; - // no drop on item - if ($(event.target).hasClass('item') || $(event.target).parent('.item').length > 0) - return false; - // recursively create directories and upload files - if (e.dataTransfer?.items?.length > 0) { - window.upload_items(e.dataTransfer.items, window.desktop_path); - } + enter: function(dragsterEvent, event) { + $('.context-menu').remove(); + }, + leave: function(dragsterEvent, event) {}, + drop: async function (dragsterEvent, event) { + const e = event.originalEvent; + // ...existing drop logic... + }, - e.stopPropagation(); - e.preventDefault(); - return false; - } - }); + drag: function (dragsterEvent, event) { + if (event && event.position && typeof event.position.left === 'number') { + if (event.position.left < 0) { + event.position.left = 0; // Only block left edge from going offscreen + } +} + +}); // -------------------------------------------------------- // Droppable