From 75d311c7e11b828078f56e37e6f092bac9bef3e8 Mon Sep 17 00:00:00 2001 From: Monte Goulding Date: Fri, 31 May 2019 16:12:25 +1000 Subject: [PATCH] [[ Bug 22124 ]] Replace the content of a file PI with dropped files This patch fixes an issue where the file property editor was inserting drag and dropped file paths rather than replacing the entire content of the field. --- .../com.livecode.pi.file.behavior.livecodescript | 15 +++++++++++++++ notes/bugfix-22124.md | 1 + 2 files changed, 16 insertions(+) create mode 100644 notes/bugfix-22124.md diff --git a/Toolset/palettes/inspector/editors/com.livecode.pi.file.behavior.livecodescript b/Toolset/palettes/inspector/editors/com.livecode.pi.file.behavior.livecodescript index e5406b639b..311f5ab779 100644 --- a/Toolset/palettes/inspector/editors/com.livecode.pi.file.behavior.livecodescript +++ b/Toolset/palettes/inspector/editors/com.livecode.pi.file.behavior.livecodescript @@ -61,3 +61,18 @@ on mouseUp pButton end if end if end mouseUp + +on dragEnter + if the dragData["files"] is empty then + pass dragEnter + end if + set the dragAction to "link" +end dragEnter + +on dragDrop + if the dragData["files"] is empty then + pass dragDrop + end if + set the text of field 1 of me to line 1 of the dragData["files"] + valueChanged +end dragDrop diff --git a/notes/bugfix-22124.md b/notes/bugfix-22124.md new file mode 100644 index 0000000000..63227177d3 --- /dev/null +++ b/notes/bugfix-22124.md @@ -0,0 +1 @@ +# Replace content of file property editors when a file is dropped onto the field \ No newline at end of file