[Spice-devel] [PATCH spice-html5 4/4] Use drag and drop for transfering files from client to guest

Jeremy White jwhite at codeweavers.com
Wed Jan 7 14:44:19 PST 2015


> +    for (var i = files.length - 1; i >= 0; i--) {

K&R...

> +
> +                if (window.File && window.FileReader && window.FileList && window.Blob) {
> +                    document.getElementById('spice-area').addEventListener('dragover', handle_file_dragover, false);
> +                    document.getElementById('spice-area').addEventListener('drop', handle_file_drop, false);
> +                } else {
> +                    console.log("File API is not supported");
> +                }

K&R , and you should remove those event listeners on disconnect, so we 
don't try to drag into a non responsive area.

(ditto for spice_auto)

Cheers,

Jeremy


More information about the Spice-devel mailing list