mirror of
https://github.com/HeyPuter/puter.git
synced 2026-08-09 07:41:25 +00:00
Fix mac setup bug (#1449)
* fix(desktop): prevent horizontal scrolling by constraining window drag #710 * docs: Force add config.example.json for Mac Docker setup (#1427) --------- Co-authored-by: Pranav Agone <pranavagone@Pranavs-MacBook-Air.local>
This commit is contained in:
co-authored by
Pranav Agone
parent
cddfa0ca11
commit
dfcf234d47
@@ -0,0 +1,31 @@
|
||||
{
|
||||
"config_name": "generated default config",
|
||||
"env": "dev",
|
||||
"nginx_mode": true,
|
||||
"server_id": "localhost",
|
||||
"http_port": "auto",
|
||||
"domain": "puter.localhost",
|
||||
"protocol": "http",
|
||||
"contact_email": "hey@example.com",
|
||||
"services": {
|
||||
"database": {
|
||||
"engine": "sqlite",
|
||||
"path": "puter-database.sqlite"
|
||||
},
|
||||
"thumbnails": {
|
||||
"engine": "purejs"
|
||||
},
|
||||
"file-cache": {
|
||||
"disk_limit": 16384,
|
||||
"disk_max_size": 16384,
|
||||
"precache_size": 16384,
|
||||
"path": "./file-cache"
|
||||
}
|
||||
},
|
||||
"cookie_name": "61ed0898-f0da-498d-a988-86f5ffcd8afe",
|
||||
"jwt_secret": "923d54d9-0911-44b3-87b1-ea3b04c5fa48",
|
||||
"url_signature_secret": "e076d914-f1c8-4c33-82a6-cc52dc469a37",
|
||||
"private_uid_secret": "cb751192555c60f8b985651bed2535738609960d69eeb177",
|
||||
"private_uid_namespace": "75deb70d-08b7-4391-b331-484d955dcfca",
|
||||
"": null
|
||||
}
|
||||
+19
-19
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user