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