epi_js 1.0.5 → 1.0.6
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 +4 -4
- data/README.md +14 -2
- data/lib/epi_js/version.rb +1 -1
- data/vendor/assets/javascripts/ajax_modal.coffee +7 -7
- data/vendor/assets/javascripts/flash_message.coffee +6 -7
- data/vendor/assets/javascripts/option_filter.coffee +15 -15
- data/vendor/assets/javascripts/table_filter.coffee +3 -3
- 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: cc6fb41f7c3d360e48126d6f183cd3e1731461bb
|
4
|
+
data.tar.gz: a80c25baa0c51b271d5ede3b07fffe90db8cf6dd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 92f6da24cc40e73663a5bbcaa8581366e434f0e60e6ab25b7bfed258bb269f4bfdaf88b1a7579189ee40e82a1618ef3d9ae732d394725f9ef10963dec1be53ec
|
7
|
+
data.tar.gz: 877ef658fc8b978be6457ee3767e3d96529fa77fe3d5ade2d36f9fa6a5ab38408a080cf00987d427586890f764dcf9b471416fe209a39035428aeb9bdc4d68ab
|
data/README.md
CHANGED
@@ -87,7 +87,7 @@ Add to your `app/assets/javascripts/application.js`
|
|
87
87
|
//= require responsive_table
|
88
88
|
|
89
89
|
And to your `app/assets/stylesheets/application.css`
|
90
|
-
|
90
|
+
|
91
91
|
*= require responsive_table
|
92
92
|
|
93
93
|
Then add `.table-responsive-xs` or `.table-responsive-sm` to tables.
|
@@ -115,7 +115,7 @@ When the value of the input element is `foo`, the element `#foo` will be visible
|
|
115
115
|
= f.input :some_select, input_html: {data: {visibility_map_scope: '.nested-fields', visibility_map: {foo: '.foo', bar: '.bar'}}}
|
116
116
|
.foo
|
117
117
|
.bar
|
118
|
-
|
118
|
+
|
119
119
|
.nested-fields
|
120
120
|
= f.input :some_select, input_html: {data: {visibility_map_scope: '.nested-fields', visibility_map: {foo: '.foo', bar: '.bar'}}}
|
121
121
|
.foo
|
@@ -137,3 +137,15 @@ Set `data-table-filter-target` on the input field you wish to filter by. This sh
|
|
137
137
|
|
138
138
|
|
139
139
|
You can overwrite the default 'No record found' message by setting `data-no-record` on the table. The span of this will default to the number of `tr` elements in `thead`, but is customisable with `data-no-record-span` on the table.
|
140
|
+
|
141
|
+
### CSS Utilities
|
142
|
+
|
143
|
+
#### Margins and Padding
|
144
|
+
|
145
|
+
.margin-top-10 puts a 10px margin at the top etc.
|
146
|
+
|
147
|
+
Also can be for specific screen sizes: .margin-top-10-sm
|
148
|
+
|
149
|
+
#### Others
|
150
|
+
|
151
|
+
.mini, .nowrap, .display-none
|
data/lib/epi_js/version.rb
CHANGED
@@ -2,24 +2,24 @@
|
|
2
2
|
'use strict'
|
3
3
|
$.ajaxModal = (url, params) ->
|
4
4
|
$.get url, params, (data) ->
|
5
|
-
$modal = if $('#modalWindow').
|
5
|
+
$modal = if $('#modalWindow').length > 0
|
6
6
|
$('#modalWindow')
|
7
7
|
else
|
8
8
|
$('<div id="modalWindow" class="modal fade" tabindex="-1" role="dialog"></div>')
|
9
|
-
|
9
|
+
|
10
10
|
alreadyShown = $modal.hasClass('in')
|
11
11
|
$modal.html(data)
|
12
12
|
$('.modal-title', $modal).attr('id', 'modalWindowTitle')
|
13
|
-
|
13
|
+
|
14
14
|
$modal.attr('aria-labelledby', 'modalWindowTitle')
|
15
15
|
$('.modal-dialog', $modal).attr('role', 'document')
|
16
16
|
|
17
17
|
$('body').append($modal.modal())
|
18
18
|
$(document).trigger('ajax-modal-show')
|
19
|
-
|
19
|
+
|
20
20
|
if alreadyShown
|
21
21
|
$(document).trigger('ajax-modal-shown')
|
22
|
-
|
22
|
+
|
23
23
|
# Bootstrap 2.x the events are shown and hidden
|
24
24
|
# Bootstrap 3.x the event is hidden.bs.modal and shown.bs.modal
|
25
25
|
$modal.on 'hidden.bs.modal hidden', (e) ->
|
@@ -28,9 +28,9 @@
|
|
28
28
|
.on 'shown.bs.modal shown', (e) ->
|
29
29
|
setTimeout("$('#modalWindow [autofocus]').first().focus()", 0)
|
30
30
|
$(document).trigger('ajax-modal-shown')
|
31
|
-
|
31
|
+
|
32
32
|
$ ->
|
33
33
|
$(document.body).on 'click', 'a.ajax-modal, a[data-toggle="ajax-modal"]', (e) ->
|
34
34
|
e.preventDefault()
|
35
35
|
$.ajaxModal $(@).attr('href'), $(@).data('params')
|
36
|
-
) jQuery
|
36
|
+
) jQuery
|
@@ -1,9 +1,9 @@
|
|
1
|
-
(($) ->
|
1
|
+
(($) ->
|
2
2
|
'use strict'
|
3
3
|
$.flashAlert = (message, type, timeout = 6000, dismissLink) ->
|
4
4
|
dismissLink ?= $.flashAlert.defaults.dismissLink
|
5
5
|
$alert = $('<div>').addClass("alert fade in #{type}").append(message).append(dismissLink)
|
6
|
-
if $('.flash-messages .alert').
|
6
|
+
if $('.flash-messages .alert').length > 2
|
7
7
|
clearTimeout $('.flash-messages .alert:last').remove().data('timeout')
|
8
8
|
$('.flash-messages').prepend($alert)
|
9
9
|
$alert.data 'timeout', setTimeout(->
|
@@ -14,16 +14,15 @@
|
|
14
14
|
dismissLink: '<a href="#" title="Hide this message" data-dismiss="alert" class="dismiss-flash">Dismiss</a>'
|
15
15
|
affix: false
|
16
16
|
}
|
17
|
-
|
17
|
+
|
18
18
|
$ ->
|
19
|
-
if $.flashAlert.defaults.affix and $('.navbar-static-top').
|
19
|
+
if $.flashAlert.defaults.affix and $('.navbar-static-top').length > 0
|
20
20
|
$('.flash-messages').affix
|
21
21
|
offset:
|
22
22
|
top: ->
|
23
23
|
$('.navbar-static-top').outerHeight(true)
|
24
|
-
|
25
|
-
if $('.flash-messages .alert').
|
24
|
+
|
25
|
+
if $('.flash-messages .alert').length > 0
|
26
26
|
$('.flash-messages .alert').addClass('in')
|
27
27
|
setTimeout("$('.flash-messages .alert').alert('close');", 6000)
|
28
28
|
) jQuery
|
29
|
-
|
@@ -5,37 +5,37 @@
|
|
5
5
|
@element = element
|
6
6
|
@filterTarget = $(@element.data('option-filter-target'))
|
7
7
|
@disableEmpty = @element.data('option-filter-disable-empty')?
|
8
|
-
|
9
|
-
@filterTarget.each ->
|
8
|
+
|
9
|
+
@filterTarget.each ->
|
10
10
|
unless $(this).data('option-filter-all-options')?
|
11
11
|
$(this).data('option-filter-all-options', $('option', $(this)))
|
12
|
-
|
12
|
+
|
13
13
|
filter: ->
|
14
14
|
valueSelected = @element.val().toString()
|
15
15
|
disableEmpty = @disableEmpty
|
16
|
-
|
16
|
+
|
17
17
|
@filterTarget.each ->
|
18
18
|
$selected = $(':selected', $(this))
|
19
|
-
|
19
|
+
|
20
20
|
$toShow = $(this).data('option-filter-all-options').filter("[data-option-filter-value='#{valueSelected}'], :not([data-option-filter-value])")
|
21
|
-
|
22
|
-
unless $toShow.filter($selected).
|
21
|
+
|
22
|
+
unless $toShow.filter($selected).length > 0
|
23
23
|
$(this).val('')
|
24
|
-
|
25
|
-
$(this).html($toShow).trigger('change.option-filter')
|
26
|
-
$(this).prop('disabled', disableEmpty and ($toShow.
|
27
|
-
|
24
|
+
|
25
|
+
$(this).html($toShow).trigger('change.option-filter')
|
26
|
+
$(this).prop('disabled', disableEmpty and ($toShow.length is 0))
|
27
|
+
|
28
28
|
$.fn.optionFilter = ->
|
29
29
|
@each ->
|
30
30
|
data = $(this).data('option-filter')
|
31
31
|
unless data?
|
32
32
|
$(this).data('option-filter', data = new OptionFilter $(this))
|
33
33
|
data.filter()
|
34
|
-
|
34
|
+
|
35
35
|
$ ->
|
36
36
|
$('input[data-visibility-map]:checked, select[data-visibility-map]').optionFilter()
|
37
|
-
|
37
|
+
|
38
38
|
$(document.body).on 'change', '[data-option-filter-target]', (e) ->
|
39
39
|
$(this).optionFilter()
|
40
|
-
|
41
|
-
) jQuery
|
40
|
+
|
41
|
+
) jQuery
|
@@ -8,7 +8,7 @@
|
|
8
8
|
colspan = if @target.data('no-record-span')?
|
9
9
|
@target.data('no-record-span')
|
10
10
|
else
|
11
|
-
$('thead th', @target).
|
11
|
+
$('thead th', @target).length
|
12
12
|
|
13
13
|
message = if @target.data('no-record')?
|
14
14
|
@target.data('no-record')
|
@@ -30,7 +30,7 @@
|
|
30
30
|
$toShow.show()
|
31
31
|
@allRows.not($toShow).hide()
|
32
32
|
|
33
|
-
if $toShow.
|
33
|
+
if $toShow.length is 0
|
34
34
|
$('tbody', @target).append(@noRecordRow)
|
35
35
|
|
36
36
|
$.fn.tableFilter = ->
|
@@ -43,4 +43,4 @@
|
|
43
43
|
$ ->
|
44
44
|
$(document).on 'keyup', '[data-table-filter-target]', (e) ->
|
45
45
|
$(this).tableFilter()
|
46
|
-
) jQuery
|
46
|
+
) jQuery
|
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.6
|
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:
|
12
|
+
date: 2017-10-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.6.10
|
144
144
|
signing_key:
|
145
145
|
specification_version: 4
|
146
146
|
summary: jQuery scripts used in various projects
|