mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-01-06 15:40:31 +08:00
Merge pull request #7096 from artoscinote/ma_SCI_10087
Block header links of smart annotation on long loads [SCI-10087]
This commit is contained in:
commit
8f96ef6eb7
1 changed files with 5 additions and 1 deletions
|
@ -57,10 +57,11 @@ var SmartAnnotation = (function() {
|
|||
callbacks: {
|
||||
remoteFilter: function(query, callback) {
|
||||
|
||||
// show loader after .25 seconds
|
||||
// show loader after .25 seconds and block other tab clicks
|
||||
var loaderTimeout = setTimeout(function() {
|
||||
$('.atwho-scroll-container').css({ height: '100px' });
|
||||
$('.atwho-scroll-container').html('<div class="loading-overlay" style="padding: 20px"></div>');
|
||||
$('.atwho-header-res').css({ 'pointer-events': 'none' });
|
||||
}, 250);
|
||||
|
||||
var $currentAtWho = $(`.atwho-view[data-at-who-id=${$(field).attr('data-smart-annotation')}]`);
|
||||
|
@ -69,6 +70,8 @@ var SmartAnnotation = (function() {
|
|||
filterType = FilterTypeEnum[$currentAtWho.find('.tab-pane.active').data('object-type')];
|
||||
if (!filterType) {
|
||||
clearTimeout(loaderTimeout);
|
||||
$('.atwho-header-res').css({ 'pointer-events': '' });
|
||||
|
||||
callback([{ name: '' }]);
|
||||
return false;
|
||||
}
|
||||
|
@ -82,6 +85,7 @@ var SmartAnnotation = (function() {
|
|||
}
|
||||
$.getJSON(filterType.dataUrl, params, function(data) {
|
||||
clearTimeout(loaderTimeout);
|
||||
$('.atwho-header-res').css({ 'pointer-events': '' });
|
||||
|
||||
localStorage.setItem('smart_annotation_states/teams/' + data.team, JSON.stringify({
|
||||
tag: filterType.tag,
|
||||
|
|
Loading…
Reference in a new issue