effective_bootstrap 0.3.21 → 0.3.22
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: 1574a75630924ef8597cd9527a4370ea425fb296
|
4
|
+
data.tar.gz: 4c63694277e88ef82e1d05f99b2dd350be5cf408
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0d061a258b2aca7adff48050b6038aef9df09294b60e5d336fbb29fa128c0d221518ff53d7a013136a39bb23967434ed4940c8d187253d8e02ffd8a5b919e53d
|
7
|
+
data.tar.gz: 1ec116b1a8c4b33ff5778c45ec6c23213270be1e3a328a2cf07c18907ebde7e97ffce9caf82506e81aba262bd20560972059d59abd80a8021351a29f02d46187
|
@@ -12,7 +12,7 @@ $(document).on 'select2:open', (event) ->
|
|
12
12
|
# https://stackoverflow.com/questions/20989458/select2-open-dropdown-on-focus
|
13
13
|
$(document).on 'select2:focus', (event) ->
|
14
14
|
$select = $(event.target)
|
15
|
-
$select.select2('open') unless $select.prop('multiple')
|
15
|
+
$select.select2('open') unless $select.prop('multiple') || $select.hasClass('disable-open-on-focus')
|
16
16
|
|
17
17
|
# effective_select custom reinitialization functionality
|
18
18
|
# This is a custom event intended to be manually triggered when the underlying options change
|
@@ -54,6 +54,7 @@ module Effective
|
|
54
54
|
('grouped' if (grouped? || polymorphic?)),
|
55
55
|
('hide-disabled' if hide_disabled?),
|
56
56
|
('tags-input' if tags?),
|
57
|
+
('disable-open-on-focus' if disable_open_on_focus?),
|
57
58
|
].compact.join(' ')
|
58
59
|
|
59
60
|
{ class: classes, multiple: (true if multiple?), include_blank: (true if include_blank?), include_null: include_null }.compact
|
@@ -121,6 +122,11 @@ module Effective
|
|
121
122
|
@single_selected = (options.delete(:single_selected) || false)
|
122
123
|
end
|
123
124
|
|
125
|
+
def disable_open_on_focus?
|
126
|
+
return @disable_open_on_focus unless @disable_open_on_focus.nil?
|
127
|
+
@disable_open_on_focus = (options.delete(:disable_open_on_focus) || false)
|
128
|
+
end
|
129
|
+
|
124
130
|
def js_template
|
125
131
|
return @js_template unless @js_template.nil?
|
126
132
|
@js_template = options.delete(:template)
|