epi_js 1.0.2 → 1.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/epi_js/version.rb +1 -1
- data/vendor/assets/javascripts/ajax_modal.coffee +10 -2
- data/vendor/assets/javascripts/option_filter.coffee +10 -13
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a1c7e3d3fa493fe3f55e16a59d2bfe3857489048
|
4
|
+
data.tar.gz: c1b6a118a5dfc2e11f2b8c7900dc7b6b19e9de2a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bba945fc6d73096edad34fe6786798d034e517af44f88918011eb4390a27f8129fce219ed8d1e4df776dee45730b1f02d829a9e1a9ccc0389fac14b5e002b4ad
|
7
|
+
data.tar.gz: efe41e0e7e61cc0bd27ef02a88b8f3ca44c2cb1f34d45a4e98a351f81504480222539beedd15ca3e5cc9bd39ccec3e549277acc5c5602e08882ce25d1f74f1f7
|
data/lib/epi_js/version.rb
CHANGED
@@ -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
|
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.
|
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
|
-
|
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
|
-
|
24
|
-
|
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-
|
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.
|
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-
|
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.
|
143
|
+
rubygems_version: 2.4.8
|
144
144
|
signing_key:
|
145
145
|
specification_version: 4
|
146
146
|
summary: jQuery scripts used in various projects
|