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: a2f09df3ec002b0cc64fcd3ff40f39f7a7aeb719
4
- data.tar.gz: 7aef2b430662c05664241e1c1b71e302b53374a8
3
+ metadata.gz: 1574a75630924ef8597cd9527a4370ea425fb296
4
+ data.tar.gz: 4c63694277e88ef82e1d05f99b2dd350be5cf408
5
5
  SHA512:
6
- metadata.gz: 9709f0a8fe1391f6e2ab3867a18503ca2bcf0ce1204c931a535bc528aec160a5adccc131ad52453586fbff4b326697fbda5f14858e3a7c06168013061fc0d29c
7
- data.tar.gz: b5e0770df1dfb7f4f6aeba1018fd719bf1362fdfb8ce4f88a95670efe00d49e0b723c15ee2a0dc296ec1e3dc121e3da710593f09ae8c476b4ad05c022a62210a
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)
@@ -1,3 +1,3 @@
1
1
  module EffectiveBootstrap
2
- VERSION = '0.3.21'.freeze
2
+ VERSION = '0.3.22'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: effective_bootstrap
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.21
4
+ version: 0.3.22
5
5
  platform: ruby
6
6
  authors:
7
7
  - Code and Effect