scinote-web/app/assets/javascripts/projects/show.js

25 lines
650 B
JavaScript
Raw Normal View History

(function() {
function init() {
$('.workflowimg-container').each(function() {
let container = $(this);
if (container.data('workflowimg-present') === false) {
let imgUrl = container.data('workflowimg-url');
container.find('.workflowimg-spinner').removeClass('hidden');
$.ajax({
url: imgUrl,
type: 'GET',
dataType: 'json',
success: function(data) {
container.html(data.workflowimg);
},
error: function() {
container.find('.workflowimg-spinner').addClass('hidden');
2016-08-19 22:38:34 +08:00
}
});
2016-08-19 21:36:12 +08:00
}
});
}
init();
}());