projects
/
Biblio-RFID.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
71187d2
)
BUGFIX: hide #working as soon as request returns
author
Dobrica Pavlinusic
<dpavlin@rot13.org>
Sat, 14 Oct 2023 13:19:37 +0000
(15:19 +0200)
committer
Dobrica Pavlinusic
<dpavlin@rot13.org>
Sat, 14 Oct 2023 13:19:37 +0000
(15:19 +0200)
examples/selfcheck.js
patch
|
blob
|
history
diff --git
a/examples/selfcheck.js
b/examples/selfcheck.js
index
8b7b029
..
a03d297
100644
(file)
--- a/
examples/selfcheck.js
+++ b/
examples/selfcheck.js
@@
-101,6
+101,10
@@
function change_page(new_state) {
}
function got_visible_tags(data,textStatus) {
}
function got_visible_tags(data,textStatus) {
+ console.log('got_visible_tags', data,textStatus);
+ wait_counter = 0;
+ $('#working').hide();
+
var html = 'No tags in range';
if ( data.tags ) {
html = '<ul class="tags">';
var html = 'No tags in range';
if ( data.tags ) {
html = '<ul class="tags">';
@@
-164,17
+168,17
@@
var wait_counter = 0;
function scan_tags() {
if ( pending_jsonp ) {
wait_counter++;
function scan_tags() {
if ( pending_jsonp ) {
wait_counter++;
- console.debug('scan_tags
disabled ', pending_jsonp, ' requests waiting cou
nter', wait_counter);
- if ( wait_counter >
3 ) $('#working').show();
+ console.debug('scan_tags
', 'tick', tick, 'pending_jsonp', pending_jsonp, ' wait_co
nter', wait_counter);
+ if ( wait_counter >
10 ) $('#working').show(); // tag_rescan = 200ms * 10 = 2s
} else {
} else {
- console.info('scan_tags',
only_reader
);
+ console.info('scan_tags',
'tock', tick, only_reader, 'wait_counter', wait_counter, 'tick', tick
);
pending_jsonp++;
$.getJSON("/scan"+only_reader+"?callback=?", got_visible_tags).fail( function(data) {
console.error('scan error pending jsonp', pending_jsonp);
pending_jsonp--;
pending_jsonp++;
$.getJSON("/scan"+only_reader+"?callback=?", got_visible_tags).fail( function(data) {
console.error('scan error pending jsonp', pending_jsonp);
pending_jsonp--;
+ wait_counter = 0;
+ $('#working').hide();
});
});
- wait_counter = 0;
- $('#working').hide();
}
if ( tick > 0 ) {
}
if ( tick > 0 ) {