From 8c85b3098d82f2db276fbcda8e142d58628bf092 Mon Sep 17 00:00:00 2001 From: Matt Pass Date: Sat, 9 Feb 2013 17:18:23 +0000 Subject: [PATCH] Inform user if there is no file/folder to copy --- lib/ice-coder.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/ice-coder.js b/lib/ice-coder.js index c9de71e..2beab2d 100644 --- a/lib/ice-coder.js +++ b/lib/ice-coder.js @@ -596,8 +596,12 @@ var ICEcoder = { // Paste a file on demand pasteFile: function(location) { - top.ICEcoder.serverQueue("add","lib/file-control.php?action=paste&file="+top.ICEcoder.copiedFile+"&location="+location); - top.ICEcoder.serverMessage('Pasting File
'+top.ICEcoder.copiedFile.toString().replace(/\|/g,"/").replace(/,/g,"\n")); + if (top.ICEcoder.copiedFile) { + top.ICEcoder.serverQueue("add","lib/file-control.php?action=paste&file="+top.ICEcoder.copiedFile+"&location="+location); + top.ICEcoder.serverMessage('Pasting File
'+top.ICEcoder.copiedFile.toString().replace(/\|/g,"/").replace(/,/g,"\n")); + } else { + top.ICEcoder.message("Nothing to paste, copy a file/folder first!"); + } }, // Upload file(s) - select & submit