Remove recent protocol button on new step (#1841)

This commit is contained in:
aignatov-bio 2019-06-19 12:49:22 +02:00 committed by GitHub
parent fb3b7918af
commit 81d10c8ce4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 7 deletions

View file

@ -452,16 +452,21 @@ function initRecentProtocols() {
// We use here ajax:success, because we want to check any change on this page
$(document).on('ajax:success', () => {
var steps = $('.step');
var protocolDescription = $('#protocol_description_view').html();
if (steps.length === 0 && protocolDescription.length === 0) {
recentProtocolContainer.css('display', '');
} else {
recentProtocolContainer.css('display', 'none');
}
updateRecentProtocolsStatus();
});
}
function updateRecentProtocolsStatus() {
var recentProtocolContainer = $('.my-module-recent-protocols');
var steps = $('.step');
var protocolDescription = $('#protocol_description_view').html();
if (steps.length === 0 && protocolDescription.length === 0) {
recentProtocolContainer.css('display', '');
} else {
recentProtocolContainer.css('display', 'none');
}
}
/**
* Initializes page
*/

View file

@ -614,6 +614,7 @@
FilePreviewModal.init();
$.initTooltips();
if (typeof refreshProtocolStatusBar === 'function') refreshProtocolStatusBar();
if (typeof updateRecentProtocolsStatus === 'function') updateRecentProtocolsStatus();
},
error: function(xhr) {
if (xhr.responseJSON['assets.file']) {