Clear event listener
This commit is contained in:
parent
d2727c4054
commit
82314241b7
@ -8403,7 +8403,7 @@
|
||||
return ImageLoader.thread = this;
|
||||
},
|
||||
node: function() {
|
||||
var URL, file, isImage, isVideo, match, replace, style, thumb, type, _ref, _ref1;
|
||||
var URL, cb, file, isImage, isVideo, match, replace, style, thumb, type, _ref, _ref1;
|
||||
if (!this.file) {
|
||||
return;
|
||||
}
|
||||
@ -8436,8 +8436,9 @@
|
||||
$.on(file, 'mouseover', ImageHover.mouseover);
|
||||
}
|
||||
}
|
||||
$.on(file, 'load loadedmetadata', (function(_this) {
|
||||
cb = (function(_this) {
|
||||
return function() {
|
||||
$.off(file, 'load loadedmetadata', cb);
|
||||
if (isVideo) {
|
||||
$.replace(thumb, file);
|
||||
_this.file.thumb = file;
|
||||
@ -8445,7 +8446,8 @@
|
||||
}
|
||||
return thumb.src = URL;
|
||||
};
|
||||
})(this));
|
||||
})(this);
|
||||
$.on(file, 'load loadedmetadata', cb);
|
||||
}
|
||||
return file.src = URL;
|
||||
},
|
||||
|
||||
@ -8420,7 +8420,7 @@
|
||||
return ImageLoader.thread = this;
|
||||
},
|
||||
node: function() {
|
||||
var URL, file, isImage, isVideo, match, replace, style, thumb, type, _ref, _ref1;
|
||||
var URL, cb, file, isImage, isVideo, match, replace, style, thumb, type, _ref, _ref1;
|
||||
if (!this.file) {
|
||||
return;
|
||||
}
|
||||
@ -8453,8 +8453,9 @@
|
||||
$.on(file, 'mouseover', ImageHover.mouseover);
|
||||
}
|
||||
}
|
||||
$.on(file, 'load loadedmetadata', (function(_this) {
|
||||
cb = (function(_this) {
|
||||
return function() {
|
||||
$.off(file, 'load loadedmetadata', cb);
|
||||
if (isVideo) {
|
||||
$.replace(thumb, file);
|
||||
_this.file.thumb = file;
|
||||
@ -8462,7 +8463,8 @@
|
||||
}
|
||||
return thumb.src = URL;
|
||||
};
|
||||
})(this));
|
||||
})(this);
|
||||
$.on(file, 'load loadedmetadata', cb);
|
||||
}
|
||||
return file.src = URL;
|
||||
},
|
||||
|
||||
@ -50,13 +50,15 @@ ImageLoader =
|
||||
file.autoplay = Conf['Autoplay']
|
||||
if Conf['Image Hover']
|
||||
$.on file, 'mouseover', ImageHover.mouseover
|
||||
$.on file, 'load loadedmetadata', =>
|
||||
cb = =>
|
||||
$.off file, 'load loadedmetadata', cb
|
||||
# Replace the thumbnail once the file has finished loading.
|
||||
if isVideo
|
||||
$.replace thumb, file
|
||||
@file.thumb = file # XXX expanding requires the post.file.thumb node.
|
||||
return
|
||||
thumb.src = URL
|
||||
$.on file, 'load loadedmetadata', cb
|
||||
file.src = URL
|
||||
|
||||
toggle: ->
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user