mirror of
https://github.com/zulip/zulip.git
synced 2025-11-11 09:27:43 +00:00
[third] Store the XHR produced by filedrop in the calling object's .data.
(imported from commit 92d165d66e09cb8fe02652b32000850665e675e5)
This commit is contained in:
@@ -68,7 +68,10 @@
|
|||||||
|
|
||||||
$.fn.filedrop = function(options) {
|
$.fn.filedrop = function(options) {
|
||||||
var opts = $.extend({}, default_opts, options),
|
var opts = $.extend({}, default_opts, options),
|
||||||
global_progress = [];
|
global_progress = []
|
||||||
|
// Humbug modification: keep a pointer to the object that the function
|
||||||
|
// was invoked on.
|
||||||
|
caller = this;
|
||||||
|
|
||||||
this.on('drop', drop).on('dragstart', opts.dragStart).on('dragenter', dragEnter).on('dragover', dragOver).on('dragleave', dragLeave);
|
this.on('drop', drop).on('dragstart', opts.dragStart).on('dragenter', dragEnter).on('dragover', dragOver).on('dragleave', dragLeave);
|
||||||
$(document).on('drop', docDrop).on('dragenter', docEnter).on('dragover', docOver).on('dragleave', docLeave);
|
$(document).on('drop', docDrop).on('dragenter', docEnter).on('dragover', docOver).on('dragleave', docLeave);
|
||||||
@@ -325,6 +328,9 @@
|
|||||||
builder,
|
builder,
|
||||||
newName = rename(file.name),
|
newName = rename(file.name),
|
||||||
mime = file.type;
|
mime = file.type;
|
||||||
|
// Humbug modification: Shunt the XHR into the parent object so we
|
||||||
|
// can interrupt it later.
|
||||||
|
caller.data("filedrop_xhr", xhr);
|
||||||
|
|
||||||
if (opts.withCredentials) {
|
if (opts.withCredentials) {
|
||||||
xhr.withCredentials = opts.withCredentials;
|
xhr.withCredentials = opts.withCredentials;
|
||||||
|
|||||||
Reference in New Issue
Block a user