Button for the 'share with yunopaste' thing

This commit is contained in:
Alexandre Aubin 2019-11-06 22:11:34 +01:00
parent 426b9df9b1
commit b84d948611
2 changed files with 10 additions and 2 deletions

View file

@ -64,6 +64,14 @@
// Render and display the view
c.view('diagnosis/diagnosis_show', data, function() {
// Configure share with yunopaste button
$("button[data-action='share']").click(function() {
c.api('GET', '/diagnosis/show?share', {}, function(data) {
c.hideLoader();
window.open(data.url, '_blank');
});
});
// Configure 'rerun diagnosis' button behavior
$("button[data-action='rerun-diagnosis']").click(function() {
var category = $(this).data("category");

View file

@ -4,9 +4,9 @@
</div>
<div class="actions-group">
<a href="javascript:void(null);" onclick="c.api('/diagnosis/show?share', function(data) { $('div.loader').remove(); window.open(data.url, '_blank'); });" class="btn btn-success">
<button class="btn btn-success" data-action="share">
<span class="fa-cloud-upload"></span> {{t 'logs_share_with_yunopaste'}}
</a>
</button>
</div>
<div class="separator"></div>