active_frontend 14.0.57 → 14.0.58
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 410ecb7142e9a3940069a50b04e2cc911f4176e9
|
4
|
+
data.tar.gz: 48f6845ad13b66025735d9dffabd96bc7683095d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 52a2cbc83490faa90a04684f1d5c2454a38b2e791e343c9b773204de68b770232bcf98c5d569cd949c8a1af4562dd6ba55cc55d6c9172efffab6e0d66f3f1055
|
7
|
+
data.tar.gz: fd55e040d75bf3f19809eaf32c475bf262e786839ccbd3bfbea4976e6d5d5f497c41b27264b707b64a2b1967eeba3642b6a7e7a5b1c17554c9902086b9867e56
|
@@ -7,7 +7,12 @@
|
|
7
7
|
var Choicepicker = function (element, options) {
|
8
8
|
this.$element = $(element);
|
9
9
|
this.settings = {
|
10
|
-
|
10
|
+
choices: this.$element.data('choices'),
|
11
|
+
text: {
|
12
|
+
all: this.$element.data('text-all') || Choicepicker.DEFAULTS.text.all,
|
13
|
+
choiceless: this.$element.data('text-choiceless') || Choicepicker.DEFAULTS.text.choiceless,
|
14
|
+
none: this.$element.data('text-none') || Choicepicker.DEFAULTS.text.none
|
15
|
+
},
|
11
16
|
type: this.$element.data('type')
|
12
17
|
};
|
13
18
|
this.options = $.extend({}, Choicepicker.DEFAULTS, this.settings, options);
|
@@ -22,15 +27,15 @@
|
|
22
27
|
|
23
28
|
Choicepicker.VERSION = '1.0.0';
|
24
29
|
Choicepicker.DEFAULTS = {
|
25
|
-
callback: function (
|
30
|
+
callback: function (choice) {},
|
31
|
+
choices: [],
|
32
|
+
choiceClass: 'form-align-vertical',
|
26
33
|
item: '<li></li>',
|
27
34
|
menu: '<ul class="choicepicker dropmenu caret"><span></span></ul>',
|
28
|
-
optionClass: 'form-align-vertical',
|
29
|
-
options: [],
|
30
35
|
text: {
|
31
36
|
all: 'All',
|
32
|
-
|
33
|
-
|
37
|
+
choiceless: 'No choices available',
|
38
|
+
none: 'None'
|
34
39
|
},
|
35
40
|
type: 'checkbox'
|
36
41
|
};
|
@@ -38,7 +43,7 @@
|
|
38
43
|
Choicepicker.prototype.constructor = Choicepicker;
|
39
44
|
|
40
45
|
Choicepicker.prototype.init = function () {
|
41
|
-
if (!this.
|
46
|
+
if (!this.hasChoices()) return;
|
42
47
|
|
43
48
|
this.elementReadOnly();
|
44
49
|
this.setWidget();
|
@@ -54,7 +59,7 @@
|
|
54
59
|
Choicepicker.prototype.clickWidget = function (e) {
|
55
60
|
e.stopPropagation();
|
56
61
|
|
57
|
-
if (!this.
|
62
|
+
if (!this.hasChoices()) return;
|
58
63
|
|
59
64
|
this.setVal();
|
60
65
|
};
|
@@ -63,7 +68,7 @@
|
|
63
68
|
var _self = this;
|
64
69
|
var menu = $(this.options.menu);
|
65
70
|
|
66
|
-
$.each(this.options.
|
71
|
+
$.each(this.options.choices, function (index, hash) {
|
67
72
|
var item = $(_self.options.item);
|
68
73
|
|
69
74
|
item.append(_self.optionTemplate(hash))
|
@@ -145,7 +150,7 @@
|
|
145
150
|
var checkbox = $('<input type="' + type +'" value="' + hash.value + '" name="' + hash.name + '" id="' + selector + '">');
|
146
151
|
checkbox.prop('checked', hash.checked);
|
147
152
|
|
148
|
-
var container = $('<div class="form-' + type + ' ' + this.options.
|
153
|
+
var container = $('<div class="form-' + type + ' ' + this.options.choiceClass + '">');
|
149
154
|
container.append(checkbox);
|
150
155
|
container.append(label);
|
151
156
|
|
@@ -173,23 +178,23 @@
|
|
173
178
|
return label + ' (+' + count + ')';
|
174
179
|
};
|
175
180
|
|
176
|
-
Choicepicker.prototype.
|
177
|
-
return Object.keys(this.options.
|
181
|
+
Choicepicker.prototype.choiceCount = function () {
|
182
|
+
return Object.keys(this.options.choices).length;
|
178
183
|
};
|
179
184
|
|
180
|
-
Choicepicker.prototype.
|
181
|
-
return this.
|
185
|
+
Choicepicker.prototype.hasChoices = function () {
|
186
|
+
return this.choiceCount() !== 0;
|
182
187
|
};
|
183
188
|
|
184
189
|
Choicepicker.prototype.setSelectionsLabel = function () {
|
185
190
|
var _self = this;
|
186
|
-
var total = this.
|
191
|
+
var total = this.choiceCount();
|
187
192
|
var count = 0;
|
188
193
|
var label = '';
|
189
194
|
|
190
|
-
if (total === 0) return this.options.text.
|
195
|
+
if (total === 0) return this.options.text.choiceless;
|
191
196
|
|
192
|
-
$.each(this.options.
|
197
|
+
$.each(this.options.choices, function (index, hash) {
|
193
198
|
if (hash.checked === undefined) {
|
194
199
|
hash.checked = false;
|
195
200
|
} else {
|
@@ -247,10 +252,12 @@
|
|
247
252
|
|
248
253
|
$(document)
|
249
254
|
.on('ready.bs.choicepicker.data-api', function () {
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
255
|
+
$('[data-toggle="choicepicker"]').each(function () {
|
256
|
+
var $this = $(this);
|
257
|
+
if ($this.data('choicepicker')) return;
|
258
|
+
Plugin.call($this, $this.data());
|
259
|
+
});
|
260
|
+
}).on('focus.bs.choicepicker.data-api click.bs.choicepicker.data-api', '[data-toggle="choicepicker"]', function (e) {
|
254
261
|
var $this = $(this);
|
255
262
|
if ($this.data('choicepicker')) return;
|
256
263
|
Plugin.call($this, $this.data());
|
@@ -492,7 +492,10 @@ textarea {
|
|
492
492
|
input,
|
493
493
|
textarea,
|
494
494
|
select {
|
495
|
-
&:focus + label
|
495
|
+
&:focus + label,
|
496
|
+
&:focus + .dropmenu + label,
|
497
|
+
&:focus + .dropdown + label,
|
498
|
+
&:focus + .dropup + label {
|
496
499
|
opacity: 1;
|
497
500
|
top: 0;
|
498
501
|
}
|
@@ -520,10 +523,6 @@ textarea {
|
|
520
523
|
vertical-align: middle;
|
521
524
|
}
|
522
525
|
|
523
|
-
.btn {
|
524
|
-
padding-left: 10px;
|
525
|
-
padding-right: 10px;
|
526
|
-
}
|
527
526
|
.form-addon {
|
528
527
|
border-style: solid;
|
529
528
|
border-width: 1px;
|