epi_js 1.0.10 → 1.0.12

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
  SHA1:
3
- metadata.gz: ca6a07f5e9daa465d4f9692f43e4712f4694d86b
4
- data.tar.gz: 69256cadb7e6df86b24a9f310eb2424867ea8dd3
3
+ metadata.gz: 39a28a9c54641127a72331953f0d3f6372819eef
4
+ data.tar.gz: 716b740b743bc48e39165ec6a0a466489f61223b
5
5
  SHA512:
6
- metadata.gz: 4b9a78656fd3d678777cc9526c52e88af427fc7c2538eb9bcbea94ada71084a94a963f0d9d368d3120c30611699cbad1862cdd68a7b4a9cc95831c4355a79a23
7
- data.tar.gz: 884c2b247a4f5c06216de0beadcbf488cda9553fddd2f5b971a3ab16f6cc5b2d12f0a2f72c1e0db93b69bc5c794c8a743e53112b9b8ce94487bd5f1f42b41d77
6
+ metadata.gz: a61f61810240604f5a17286ee1739d5648aec6bcf25eb4ecba5a3965d14a7acfec08ee9a59e9564c59ea9d014f01283bc13f255f4d1779f9cba93106009bc474
7
+ data.tar.gz: 4996251ba1005c3294ab924f387acfd9e96d3154d8f98563f87e21978ae62cd2a1b30bf476aa1ed238b274b541776031bacca42be8bc698753cd362b751abe1b
@@ -1,3 +1,3 @@
1
1
  module EpiJs
2
- VERSION = "1.0.10"
2
+ VERSION = "1.0.12"
3
3
  end
@@ -24,5 +24,9 @@
24
24
 
25
25
  if $('.flash-messages .alert').length > 0
26
26
  $('.flash-messages .alert').addClass('in')
27
- setTimeout("$('.flash-messages .alert').alert('close');", 6000)
27
+ setTimeout(
28
+ ->
29
+ $('.flash-messages .alert').alert('close')
30
+ , 6000
31
+ )
28
32
  ) jQuery
@@ -4,7 +4,7 @@
4
4
  constructor: (element) ->
5
5
  @element = element
6
6
  @target = $(@element.data('table-filter-target'))
7
- @allRows = $('tbody tr:not(.tr-no-record)', @target)
7
+
8
8
  colspan = if @target.data('no-record-span')?
9
9
  @target.data('no-record-span')
10
10
  else
@@ -18,21 +18,24 @@
18
18
  @noRecordRow = $("<tr class='tr-no-record'><td colspan=#{colspan}>#{message}</td></tr>")
19
19
  filter: ->
20
20
  $('.tr-no-record', @target).remove()
21
+ allRows = @allRows()
21
22
  keyword = @element.val().toLowerCase()
22
23
 
23
24
  $toShow = if keyword is ''
24
- @allRows
25
+ allRows
25
26
  else
26
- @allRows.filter ->
27
+ allRows.filter ->
27
28
  trText = $(this).clone().find('.btn').remove().end().text().toLowerCase()
28
29
  trText.indexOf(keyword) > -1
29
30
 
30
31
  $toShow.show()
31
- @allRows.not($toShow).hide()
32
+ allRows.not($toShow).hide()
32
33
 
33
34
  if $toShow.length is 0
34
35
  $('tbody', @target).append(@noRecordRow)
35
36
 
37
+ allRows: ->
38
+ $('tbody tr:not(.tr-no-record)', @target)
36
39
  $.fn.tableFilter = ->
37
40
  @each ->
38
41
  data = $(this).data('table-filter')
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: epi_js
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.10
4
+ version: 1.0.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shuo Chen
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2018-04-24 00:00:00.000000000 Z
12
+ date: 2018-09-25 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: railties