epi_js 1.0.2 → 1.0.3

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: 85946da973e194c5338ab9151db06cf6577a041d
4
- data.tar.gz: 4c4164c02a4ffee89dc58fff07911a0e6d809218
3
+ metadata.gz: a1c7e3d3fa493fe3f55e16a59d2bfe3857489048
4
+ data.tar.gz: c1b6a118a5dfc2e11f2b8c7900dc7b6b19e9de2a
5
5
  SHA512:
6
- metadata.gz: 747e9f051cdbde2fd52cc79d4c62662639c4a95ed4c282596a8522b470eb2d387fb470e98af3307902977130e0cf77d2bf8705c0fcfa33630c2dafb295e1625d
7
- data.tar.gz: 27f9283424d00ef506df7fddab591b0f29bd93adca1fb80d02512451c1fd9b69f8fbaccc6cb870e48c0847ec79814e8fd01d675af5060224a444ce1a3e90abef
6
+ metadata.gz: bba945fc6d73096edad34fe6786798d034e517af44f88918011eb4390a27f8129fce219ed8d1e4df776dee45730b1f02d829a9e1a9ccc0389fac14b5e002b4ad
7
+ data.tar.gz: efe41e0e7e61cc0bd27ef02a88b8f3ca44c2cb1f34d45a4e98a351f81504480222539beedd15ca3e5cc9bd39ccec3e549277acc5c5602e08882ce25d1f74f1f7
@@ -1,3 +1,3 @@
1
1
  module EpiJs
2
- VERSION = "1.0.2"
2
+ VERSION = "1.0.3"
3
3
  end
@@ -2,11 +2,19 @@
2
2
  'use strict'
3
3
  $.ajaxModal = (url, params) ->
4
4
  $.get url, params, (data) ->
5
- $modal = if $('#modalWindow').size() > 0 then $('#modalWindow') else $('<div>').addClass('modal fade').attr('id', 'modalWindow')
5
+ $modal = if $('#modalWindow').size() > 0
6
+ $('#modalWindow')
7
+ else
8
+ $('<div id="modalWindow" class="modal fade" tabindex="-1" role="dialog"></div>')
6
9
 
7
10
  alreadyShown = $modal.hasClass('in')
11
+ $modal.html(data)
12
+ $('.modal-title', $modal).attr('id', 'modalWindowTitle')
13
+
14
+ $modal.attr('aria-labelledby', 'modalWindowTitle')
15
+ $('.modal-dialog', $modal).attr('role', 'document')
8
16
 
9
- $('body').append($modal.html(data).modal())
17
+ $('body').append($modal.modal())
10
18
  $(document).trigger('ajax-modal-show')
11
19
 
12
20
  if alreadyShown
@@ -4,24 +4,21 @@
4
4
  constructor: (element) ->
5
5
  @element = element
6
6
  @filterTarget = $(@element.data('option-filter-target'))
7
- @allOptions = $('[data-option-filter-value]', @filterTarget)
8
-
9
7
  @disableEmpty = @element.data('option-filter-disable-empty')?
10
8
 
9
+ @filterTarget.each ->
10
+ unless $(this).data('option-filter-all-options')?
11
+ $(this).data('option-filter-all-options', $('option', $(this)))
12
+
11
13
  filter: ->
12
14
  valueSelected = @element.val().toString()
15
+ disableEmpty = @disableEmpty
13
16
 
14
- filteredOptionsCount = 0
15
-
16
- if valueSelected is ''
17
- @allOptions.hide()
18
- else
19
- $toShow = @allOptions.filter("[data-option-filter-value='#{valueSelected}']").show()
20
- @allOptions.not($toShow).hide()
21
- filteredOptionsCount = $toShow.size()
17
+ @filterTarget.each ->
18
+ $toShow = $(this).data('option-filter-all-options').filter("[data-option-filter-value='#{valueSelected}'], :not([data-option-filter-value])")
22
19
 
23
- @filterTarget.val('').trigger('change.option-filter')
24
- @filterTarget.prop('disabled', @disableEmpty and (filteredOptionsCount is 0))
20
+ $(this).html($toShow).val('').trigger('change.option-filter')
21
+ $(this).prop('disabled', disableEmpty and ($toShow.size() is 0))
25
22
 
26
23
  $.fn.optionFilter = ->
27
24
  @each ->
@@ -31,7 +28,7 @@
31
28
  data.filter()
32
29
 
33
30
  $ ->
34
- $('[data-option-filter-target]').optionFilter()
31
+ $('input[data-visibility-map]:checked, select[data-visibility-map]').optionFilter()
35
32
 
36
33
  $(document.body).on 'change', '[data-option-filter-target]', (e) ->
37
34
  $(this).optionFilter()
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.2
4
+ version: 1.0.3
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: 2016-04-07 00:00:00.000000000 Z
12
+ date: 2016-05-06 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: railties
@@ -140,7 +140,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
140
140
  version: '0'
141
141
  requirements: []
142
142
  rubyforge_project:
143
- rubygems_version: 2.5.1
143
+ rubygems_version: 2.4.8
144
144
  signing_key:
145
145
  specification_version: 4
146
146
  summary: jQuery scripts used in various projects