abort preview thumbnail ajax request when leaving the zone (#4731)
This commit is contained in:
parent
993fe872f8
commit
852aebb677
|
@ -269,10 +269,13 @@
|
|||
};
|
||||
|
||||
$.querywidget.updatePreviewLinks = function () {
|
||||
var xhr_preview = null;
|
||||
$('.ResultsTasksTable tr a, .ResultsTable tr a').hover(function() {
|
||||
$('#preview-doc').remove();
|
||||
$.getJSON($(this).attr('href') + '/@@preview',
|
||||
if (xhr_preview !== null) xhr_preview.abort();
|
||||
xhr_preview = $.getJSON($(this).attr('href') + '/@@preview',
|
||||
function (data) {
|
||||
xhr_preview = null;
|
||||
$('#preview-doc').remove();
|
||||
if (data.thumbnail_url) {
|
||||
$('body').append('<div id="preview-doc">');
|
||||
|
@ -280,6 +283,7 @@
|
|||
}
|
||||
});
|
||||
}, function() {
|
||||
if (xhr_preview !== null) xhr_preview.abort();
|
||||
$('#preview-doc').remove();
|
||||
});
|
||||
};
|
||||
|
|
Reference in New Issue