effective_bootstrap 0.10.11 → 0.10.14

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: faec7cf96ce05f8354a1f861f7ddbfc69993d9cc72645d4386e3a75d83d268e6
4
- data.tar.gz: 64c72a6d74234cdb15502e6292c69089c637392c464b57dd323ddf36cbe28f80
3
+ metadata.gz: 7def34ec9dc81a3f0d75be46a758bbef451f8b8eb589c3d45e339219b3ffebd3
4
+ data.tar.gz: 2502f9cb998f7627048892094f9746a46cd03762bd09028d22cd6c839afb9f75
5
5
  SHA512:
6
- metadata.gz: fa78150a15a5bbc41fdd79a09569a1d34f5cad972dc56ecfba51e8988588b2c047586029ad58b6829c5cd71ef4673238d41ed83382f94aadd26b59195e54328a
7
- data.tar.gz: 0a23c6d1f743b83b31e12a8e9535c4b3484e03a992f8c0659dae349f9c2db3987c8cc02e1ab6a57209ebfa4c67a8e8b6af11565e449840490ede83bb8045c49d
6
+ metadata.gz: 10224457b7040e414505ee7a6f8c79558aa1e03d21e88fc5f8509c2faa260c6df45a025ea6bd032572ab7d602162910418d8f9a7fb469924cd9995ce8eca34d2
7
+ data.tar.gz: d4c0ffd205cbfd7849fdb5b64ec8d0235e5c3abc0929f94306188fd855a8f3815e9ffb16ac7c886f54b127731b29a7c2d276becb31ff0a69f7b7e3fbaa0e23ab
@@ -15,6 +15,7 @@
15
15
  else
16
16
  $element.fadeIn()
17
17
  $element.find('input,textarea,select,button').removeAttr('disabled')
18
+ $element.find('textarea.effective_article_editor').each (i, editor) -> ArticleEditor('#' + $(editor).attr('id')).enable()
18
19
 
19
20
  # Maybe disable it now
20
21
  if options.needDisable
@@ -35,6 +36,7 @@
35
36
  if matches
36
37
  $element.fadeIn()
37
38
  $element.find('input,textarea,select,button').removeAttr('disabled')
39
+ $element.find('textarea.effective_article_editor').each (i, editor) -> ArticleEditor('#' + $(editor).attr('id')).enable()
38
40
  else
39
41
  $element.hide()
40
42
  $element.find('input,textarea,select,button').prop('disabled', true)
@@ -54,6 +56,8 @@
54
56
  if found
55
57
  $element.fadeIn()
56
58
  $element.find('input,textarea,select,button').removeAttr('disabled')
59
+ $element.find('textarea.effective_article_editor').each (i, editor) -> ArticleEditor('#' + $(editor).attr('id')).enable()
60
+
57
61
  else
58
62
  $element.hide()
59
63
  $element.find('input,textarea,select,button').prop('disabled', true)
@@ -7,6 +7,8 @@ $(document).on 'cocoon:before-remove', (event, $obj) ->
7
7
 
8
8
  if confirm && !confirmed
9
9
  event.preventDefault()
10
+ else if $button.data('skip-fadeout')
11
+ # Nothing to do
10
12
  else
11
13
  $(event.target).data('remove-timeout', 1000)
12
14
  $obj.fadeOut('slow')
@@ -1,24 +1,24 @@
1
1
  # https://select2.github.io/examples.html
2
2
 
3
- formatWithGlyphicon = (data, container) ->
4
- if data.element && data.element.className
5
- $("<span><i class='glyphicon #{data.element.className}'></i> #{data.text}</span>")
6
- else
7
- data.text
8
-
9
- formatWithHtml = (data, container) ->
3
+ effectiveFormat = (data, container) ->
10
4
  if data.element && data.element.getAttribute('data-html')
11
5
  $(data.element.getAttribute('data-html'))
6
+ else if data.text.startsWith("<") && data.text.endsWith(">")
7
+ $(data.text)
12
8
  else
13
9
  data.text
14
10
 
15
- matchWithHtml = (params, data) ->
11
+ effectiveMatch = (params, data) ->
16
12
  return data if $.trim(params.term) == ''
17
13
  return null unless data.element?
18
14
 
19
15
  # Single item mode
20
16
  term = params.term.toLowerCase()
17
+
18
+ # The text value
21
19
  text = $(data.element.getAttribute('data-html')).text()
20
+ text = $(data.text).text() if text.length == 0
21
+ text = data.text if text.length == 0
22
22
 
23
23
  if(text.length > 0)
24
24
  if text.toLowerCase().indexOf(term) > -1 then return(data) else return(null)
@@ -29,7 +29,11 @@ matchWithHtml = (params, data) ->
29
29
  filteredChildren = []
30
30
 
31
31
  $.each(data.children, (idx, child) ->
32
+ # Text value
32
33
  text = $(child.element.getAttribute('data-html')).text()
34
+ text = $(data.text).text() if text.length == 0
35
+ text = data.text if text.length == 0
36
+
33
37
  filteredChildren.push(child) if text.toLowerCase().indexOf(term) > -1
34
38
  )
35
39
 
@@ -41,14 +45,9 @@ matchWithHtml = (params, data) ->
41
45
  return modifiedData
42
46
 
43
47
  (this.EffectiveBootstrap || {}).effective_select = ($element, options) ->
44
- switch options['template']
45
- when 'glyphicon'
46
- options['templateResult'] = formatWithGlyphicon
47
- options['templateSelection'] = formatWithGlyphicon
48
- when 'html'
49
- options['templateResult'] = formatWithHtml
50
- options['templateSelection'] = formatWithHtml
51
- options['matcher'] = matchWithHtml
48
+ options['templateResult'] = effectiveFormat
49
+ options['templateSelection'] = effectiveFormat
50
+ options['matcher'] = effectiveMatch
52
51
 
53
52
  if options['noResults']
54
53
  noResults = options['noResults']
@@ -1,3 +1,3 @@
1
1
  module EffectiveBootstrap
2
- VERSION = '0.10.11'.freeze
2
+ VERSION = '0.10.14'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: effective_bootstrap
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.11
4
+ version: 0.10.14
5
5
  platform: ruby
6
6
  authors:
7
7
  - Code and Effect
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-06-06 00:00:00.000000000 Z
11
+ date: 2022-08-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails