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