MCPcopy Create free account
hub / github.com/dylan-sutton-chavez/edge-python / hasTextOrFiles

Function hasTextOrFiles

docs/components/editor.js:326–330  ·  view source on GitHub ↗
(dt)

Source from the content-addressed store, hash-verified

324
325 // Drag-and-drop of text or .py files. Fires `drop`, not `paste`.
326 const hasTextOrFiles = (dt) => {
327 if (!dt) return false;
328 const types = Array.from(dt.types || []);
329 return types.includes('text/plain') || types.includes('Files');
330 };
331 ed.addEventListener('dragover', (e) => { if (hasTextOrFiles(e.dataTransfer)) e.preventDefault(); }, { signal });
332 ed.addEventListener('drop', async (e) => {
333 const dt = e.dataTransfer; if (!hasTextOrFiles(dt)) return;

Callers 1

createEditorFunction · 0.85

Calls 1

fromMethod · 0.80

Tested by

no test coverage detected