five-two-nw-olivander 0.2.0.11 → 0.2.0.13
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 32975e399247cbaadcd9c20ad92f234a8b1d1d6e6309c5ffb9356ad2e91cf3ce
|
4
|
+
data.tar.gz: d13e34fff93d0fcba192c6adf841e5102e600cd27e9d6e48711fa4a6165658f9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d79a012a2dd882b152c251bb8a3fa0dc63232cfcaaf054c6ce8b9cb5bf917d9818a61cd121ed672febd0f3291113f27b601292090d42ac353d37346e137776d7
|
7
|
+
data.tar.gz: 9e835c5d61f5c40e9a43182224f353ddfc53a89b9c83e40292d828cd535bb0c054dd9ed4a6a63c142f948b312300f20ac90c2e10e1d7a25d7fa010268dc6a501
|
@@ -3,12 +3,14 @@ import { Controller } from "@hotwired/stimulus"
|
|
3
3
|
// Connects to data-controller="input-control-association"
|
4
4
|
export default class extends Controller {
|
5
5
|
connect() {
|
6
|
+
console.log('setting up')
|
6
7
|
var self = this,
|
7
8
|
el = self.element;
|
8
9
|
|
9
|
-
if (!$(el).hasClass("select2-hidden-accessible")) {
|
10
|
+
if (el.dataset.forceSelect2 || !$(el).hasClass("select2-hidden-accessible")) {
|
10
11
|
$(el).select2({
|
11
12
|
dropdownParent: $(el).parent(),
|
13
|
+
minimumInputLength: el.dataset.minimumInputLength || 0,
|
12
14
|
tags: el.dataset.taggable == 'true',
|
13
15
|
createTag: function (tag) {
|
14
16
|
return {
|
@@ -20,8 +22,19 @@ export default class extends Controller {
|
|
20
22
|
ajax: {
|
21
23
|
url: el.dataset.collectionPath,
|
22
24
|
delay: 250,
|
23
|
-
minimumInputLength: 2,
|
24
25
|
dataType: 'json',
|
26
|
+
data: function(params) {
|
27
|
+
var hash = {
|
28
|
+
term: params.term,
|
29
|
+
_type: params._type,
|
30
|
+
}
|
31
|
+
|
32
|
+
if (el.dataset.tagParentId) {
|
33
|
+
hash[el.dataset.tagParentSearch] = el.dataset.tagParentId
|
34
|
+
}
|
35
|
+
|
36
|
+
return hash;
|
37
|
+
},
|
25
38
|
processResults: function(data) {
|
26
39
|
return { results: data.map(function(map) {
|
27
40
|
return {
|
@@ -40,6 +53,7 @@ export default class extends Controller {
|
|
40
53
|
data = new FormData()
|
41
54
|
data.append("authenticity_token", document.querySelector('meta[name="csrf-token"]').content)
|
42
55
|
data.append(el.dataset.tagFieldName, tag.text)
|
56
|
+
data.append(el.dataset.tagParentField, el.dataset.tagParentId)
|
43
57
|
fetch(el.dataset.collectionPath, {
|
44
58
|
method: 'POST',
|
45
59
|
headers: {
|
data/lib/olivander/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: five-two-nw-olivander
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.0.
|
4
|
+
version: 0.2.0.13
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Eric Dennis
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-04-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: chartkick
|