display document thumbnails on hover (#4731)
This commit is contained in:
parent
9fad11a391
commit
b20a1989ee
|
@ -831,3 +831,17 @@ tr.row-state-finished a[href$="/edit"] {
|
|||
box-shadow: none;
|
||||
}
|
||||
}
|
||||
|
||||
#preview-doc {
|
||||
position: fixed;
|
||||
bottom: 2%;
|
||||
right: 2%;
|
||||
width: 30%;
|
||||
z-index: 54321;
|
||||
box-shadow: 0 2px 2px black;
|
||||
background: white;
|
||||
}
|
||||
|
||||
#preview-doc img {
|
||||
width: 100%;
|
||||
}
|
||||
|
|
|
@ -42,4 +42,17 @@ $(function() {
|
|||
}
|
||||
return false;
|
||||
});
|
||||
$('.ResultsTasksTable tr a').hover(function() {
|
||||
$('#preview-doc').remove();
|
||||
$.getJSON($(this).attr('href') + '/@@preview',
|
||||
function (data) {
|
||||
$('#preview-doc').remove();
|
||||
if (data.thumbnail_url) {
|
||||
$('body').append('<div id="preview-doc">');
|
||||
$('#preview-doc').append('<img src="' + data.thumbnail_url + '"/>');
|
||||
}
|
||||
});
|
||||
}, function() {
|
||||
$('#preview-doc').remove();
|
||||
});
|
||||
});
|
||||
|
|
Reference in New Issue