thecore_dataentry_commons 1.2.17 → 1.2.18

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a7428d5cac8ccb2481616703ec8678ea618636ab
4
- data.tar.gz: 80d94339235a72d5f08745775dbfa6c660455489
3
+ metadata.gz: e6a6d24066232d13b01cc781a5612a33c64ea3e6
4
+ data.tar.gz: '09cad34e4cde3408ac24921fb31d07c3641a14b7'
5
5
  SHA512:
6
- metadata.gz: ba2f184302c47618360facd7bb2de322d7945cb2813ec995b2e0a38c23c6976e33c792b378e09b9ce5c5a94ac97a1592e834bbd6301c9076132dba0d8fb344a2
7
- data.tar.gz: bee107cf4ec6ff0925d11f36b2d6fa5d35d482cef40a6ad8a9a27a7bb2b33cd2412f8e193b1c906657ecbfa48ff9f97553cd4410ad3358bd1fc9a1c489f2bb01
6
+ metadata.gz: 3a5720dc3f768ad7c6a7320a5271b0d3b4f10b923856b8ea7ecfa4a6fbaf630622724fe556f7b3ebc8e8f757a86e8827ea291fd6c29b8595c450377940dd4039
7
+ data.tar.gz: ba51b13ee8e8fa9fede52260ef9d045537e13fb4eb11e431c66793e2579bb4c570d3165e145049a5c2bdb3767b19acb460a5c1cd31349e3526ec3b9db0e73161
@@ -4,7 +4,7 @@
4
4
  // then "click" the send button
5
5
  event.stopPropagation();
6
6
  var keycode = (event.keyCode ? event.keyCode : event.which);
7
- //console.log(keycode);
7
+ // console.log(keycode);
8
8
  if (keycode == '13') {
9
9
  $("#send").click();
10
10
  return true;
@@ -13,7 +13,7 @@
13
13
  }
14
14
  var kpMode = "<%= Settings.datawedge_kp_mode %>";
15
15
  // var clickedBtn; var code; Gestisco il keypress sull'input
16
- $("input[name=barcode]").on(kpMode, keypressAndReturn);
16
+ // $("#barcode").on(kpMode, keypressAndReturn);
17
17
 
18
18
  function resetCurrentBtn() {
19
19
  $("#send").button('reset');
@@ -23,22 +23,30 @@
23
23
  }
24
24
  // var clickedBtn; var code; Gestisco il keypress sull'input
25
25
  function manageScannedKeystrokes(event) {
26
+ // console.log(event);
27
+ event.stopPropagation();
26
28
  if(!keypressAndReturn(event)) {
27
- $("#send").focus();
29
+ // $("#send").focus();
28
30
  // Scrivilo nell'input field (accumulando)
29
- $("input[name=barcode]").val(function (index, val) {
30
- // Scrivo
31
+ // Only if target.id is different from "barcode"
32
+ // Otherwise well get duplicate keystrokes
33
+ if(event.target.id != "barcode")
34
+ $("#barcode").val(function (index, val) {
35
+ // Write
31
36
  return val + event.key;
32
37
  });
33
38
  }
34
39
  }
35
40
  function enableKSCapture(){
36
41
  $(document).on(kpMode, manageScannedKeystrokes);
42
+ $("#barcode").off(kpMode, manageScannedKeystrokes);
37
43
  }
38
44
  function disableKSCapture(){
39
45
  $(document).off(kpMode, manageScannedKeystrokes);
46
+ $("#barcode").on(kpMode, manageScannedKeystrokes);
40
47
  }
41
48
 
49
+ // $("#send").focus();
42
50
  // Init
43
51
  enableKSCapture();
44
52
  // Se $("#barcode") si becca il focus, elimino il keypress
@@ -50,5 +58,4 @@
50
58
  // Blocco il keypress del document
51
59
  enableKSCapture();
52
60
  });
53
- $("#send").focus();
54
61
  </script>
@@ -1,3 +1,3 @@
1
1
  module ThecoreDataentryCommons
2
- VERSION = '1.2.17'
2
+ VERSION = '1.2.18'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: thecore_dataentry_commons
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.17
4
+ version: 1.2.18
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gabriele Tassoni
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-01-31 00:00:00.000000000 Z
11
+ date: 2018-02-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thecore_settings