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 +4 -4
- data/lib/active_frontend/version.rb +1 -1
- data/vendor/assets/javascripts/base/_selectpicker.js +21 -11
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c43f51e2ff3c462619cfcf863ef950a86c0af80ff147b2eb7481748de29e587e
|
4
|
+
data.tar.gz: 60595986e4aef5576af27a6cb6c9a043f75c47722e776832f656884c7e83ece8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ccce633224909c3d5f32d4d61cb208e72578280233f422e16e6ee0f9e5374b2c36602b1e3a14f7e1b6ca1bc0f2649be3c6693637433814f66a0c78717073d832
|
7
|
+
data.tar.gz: 953860de54d84dbce0e5dfde58d1f4d17e3632effe16ade477e8c7b02fd731e8e74566bf7d23fee4b32e3796cf0a61188d68c206d0525fc4ab3853d261537043
|
@@ -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
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
this.
|
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.
|
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-
|
11
|
+
date: 2018-03-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|