active_frontend 16.0.15 → 16.0.16

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
  SHA256:
3
- metadata.gz: d3c6267fcb7117c4f0050852efca763387fa8a013fb65754ecba9619707d2e4b
4
- data.tar.gz: 429e6dc1c828840661065ecd144e7addd650b13920e1d4bee2337d45c909efee
3
+ metadata.gz: c43f51e2ff3c462619cfcf863ef950a86c0af80ff147b2eb7481748de29e587e
4
+ data.tar.gz: 60595986e4aef5576af27a6cb6c9a043f75c47722e776832f656884c7e83ece8
5
5
  SHA512:
6
- metadata.gz: 425e12e2ec639c5d0879adaeb52b980057f09b0d7795f8ab636eab09c235ebc77d8dead562e970a10212ccdb6dac7e11a47f8f85072b4b36c0ed5e936fbdb12d
7
- data.tar.gz: 9526efc4b7af5658e3cc570d2d7037b42280fe9d3313e52e7bf56e1cbe87441f99c92b24cdab3efda274a01f91c5e96d71fd8e0305daaab024a1e7cf11868492
6
+ metadata.gz: ccce633224909c3d5f32d4d61cb208e72578280233f422e16e6ee0f9e5374b2c36602b1e3a14f7e1b6ca1bc0f2649be3c6693637433814f66a0c78717073d832
7
+ data.tar.gz: 953860de54d84dbce0e5dfde58d1f4d17e3632effe16ade477e8c7b02fd731e8e74566bf7d23fee4b32e3796cf0a61188d68c206d0525fc4ab3853d261537043
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ActiveFrontend
4
- VERSION ||= '16.0.15'
4
+ VERSION ||= '16.0.16'
5
5
  end
@@ -19,6 +19,7 @@
19
19
  };
20
20
  this.options = $.extend({}, Selectpicker.DEFAULTS, this.settings, options);
21
21
 
22
+ this.$touchDevice = ('ontouchstart' in window || navigator.msMaxTouchPoints);
22
23
  this.$optgroups = this.getOptgroups();
23
24
  this.$options = this.getOptions();
24
25
  this.$selected = this.getSelectedOptionVal();
@@ -54,18 +55,27 @@
54
55
  Selectpicker.prototype.init = function () {
55
56
  if (!this.hasSelects()) return;
56
57
 
57
- this.setWidget();
58
-
59
- this.$element.on('mousedown', function (e) {
60
- e.stopPropagation();
61
- e.preventDefault();
62
- this.blur();
63
- this.focus();
64
- }).on({
65
- 'focus.bs.selectpicker': $.proxy(this.showWidget, this),
66
- 'click.bs.selectpicker': $.proxy(this.showWidget, this),
67
- 'blur.bs.selectpicker': $.proxy(this.setVal, this)
58
+ if (this.$touchDevice) {
59
+ var _self = this;
60
+ var old_value = this.$element.val();
61
+
62
+ this.$element.change(function (e) {
63
+ _self.options.onChangeCallback(old_value, this.value);
68
64
  });
65
+ } else {
66
+ this.setWidget();
67
+
68
+ this.$element.on('mousedown', function (e) {
69
+ e.stopPropagation();
70
+ e.preventDefault();
71
+ this.blur();
72
+ this.focus();
73
+ }).on({
74
+ 'focus.bs.selectpicker': $.proxy(this.showWidget, this),
75
+ 'click.bs.selectpicker': $.proxy(this.showWidget, this),
76
+ 'blur.bs.selectpicker': $.proxy(this.setVal, this)
77
+ });
78
+ }
69
79
  };
70
80
 
71
81
  Selectpicker.prototype.clickWidget = function (e) {
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_frontend
3
3
  version: !ruby/object:Gem::Version
4
- version: 16.0.15
4
+ version: 16.0.16
5
5
  platform: ruby
6
6
  authors:
7
7
  - Juan Gomez
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-03-15 00:00:00.000000000 Z
11
+ date: 2018-03-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails