display document thumbnails on hover (#4731)
This commit is contained in:
parent
16d765b2c1
commit
993fe872f8
|
@ -115,6 +115,7 @@
|
|||
$.querywidget.updateBatchSizeMenu();
|
||||
$.querywidget.updateExtraColumnsMenu();
|
||||
$.querywidget.updateTableHeaders();
|
||||
$.querywidget.updatePreviewLinks();
|
||||
});
|
||||
};
|
||||
$.querywidget.updateBatchLinks = function (query, query_extra_columns) {
|
||||
|
@ -130,6 +131,7 @@
|
|||
$.querywidget.updateBatchSizeMenu();
|
||||
$.querywidget.updateExtraColumnsMenu();
|
||||
$.querywidget.updateTableHeaders();
|
||||
$.querywidget.updatePreviewLinks();
|
||||
});
|
||||
return false;
|
||||
});
|
||||
|
@ -266,6 +268,22 @@
|
|||
return result;
|
||||
};
|
||||
|
||||
$.querywidget.updatePreviewLinks = function () {
|
||||
$('.ResultsTasksTable tr a, .ResultsTable 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();
|
||||
});
|
||||
};
|
||||
|
||||
}(jQuery));
|
||||
|
||||
function update_portaltypes()
|
||||
|
|
|
@ -14,7 +14,10 @@
|
|||
<span class="portletTopRight"></span>
|
||||
</dt>
|
||||
|
||||
<dd class="portletItem" tal:content="structure python: view.table().render()">
|
||||
<dd class="portletItem" tal:define="table python: view.table()">
|
||||
<div tal:attributes="class python: table.__class__.__name__"
|
||||
tal:content="structure python: table.render()">
|
||||
</div>
|
||||
</dd>
|
||||
|
||||
<dd class="portletFooter">
|
||||
|
|
|
@ -40,7 +40,7 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<div class="table-container">
|
||||
<div tal:attributes="class python: 'table-container ' + context.table.__class__.__name__">
|
||||
<div tal:condition="results"
|
||||
tal:replace="structure python: context.table.render()"/>
|
||||
|
||||
|
|
Reference in New Issue