effective_bootstrap 0.0.16 → 0.0.17
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/javascripts/effective_bootstrap.js +1 -0
- data/app/assets/javascripts/effective_bootstrap/base.js.coffee +2 -1
- data/app/assets/javascripts/effective_bootstrap/form.js.coffee +6 -7
- data/app/assets/javascripts/effective_checks/initialize.js.coffee +7 -0
- data/app/assets/javascripts/effective_checks/input.js +1 -0
- data/app/models/effective/form_inputs/checks.rb +5 -1
- data/lib/effective_bootstrap/version.rb +1 -1
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 814a8b4e6bdf2467b24d3da74f3bb1e9087498a2
|
4
|
+
data.tar.gz: d4cb17d21b10ad278917c6ccca0c7b74917b6633
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e22c354653c0d974664697e82bd28d4de6d43e7c1bc9da020c8d621efa3038f688f1c4c06b145101f7f7bdbfdc0f944fead4d3b01e632dd47a586ab7bb712702
|
7
|
+
data.tar.gz: 83d363deff4e780b5605a052fd6d70294d29fb7be34e23393222e6003cd5f3ef2c5ff4d3b39ea706cac6d66fe3f68e815df91fe63d9f154c03363cc484db11f0
|
@@ -1,3 +1,4 @@
|
|
1
|
+
# This initializes all the effective_* form inputs also in this gem
|
1
2
|
this.EffectiveBootstrap ||= new class
|
2
3
|
initialize: (target) ->
|
3
4
|
$(target || document).find('[data-input-js-options]:not(.initialized)').each (i, element) ->
|
@@ -36,7 +37,7 @@ $(document).on 'confirm', (event) ->
|
|
36
37
|
, 4000)
|
37
38
|
false # don't show the confirmation dialog
|
38
39
|
|
39
|
-
$.rails.confirm = (message) -> true
|
40
|
+
$.rails.confirm = (message) -> true if $.rails
|
40
41
|
$(document).on 'confirm:complete', (event) -> $(event.target).data('confirmed')
|
41
42
|
|
42
43
|
# Fade out cocoon remove.
|
@@ -1,6 +1,6 @@
|
|
1
1
|
this.EffectiveForm ||= new class
|
2
2
|
current_submit: '' # The $(.form-actions) that clicked
|
3
|
-
remote_form_payload: '' #
|
3
|
+
remote_form_payload: '' # String containing html from server side render of this form
|
4
4
|
remote_form_flash: '' # Array of Arrays
|
5
5
|
|
6
6
|
validate: (form) ->
|
@@ -62,10 +62,11 @@ this.EffectiveForm ||= new class
|
|
62
62
|
$form = ''
|
63
63
|
|
64
64
|
if @remote_form_payload.length > 0
|
65
|
-
$
|
66
|
-
$form =
|
65
|
+
$payload = $("<div>#{@remote_form_payload}</div>")
|
66
|
+
$form = $payload.find("form[data-remote-index='#{$target.data('remote-index')}']")
|
67
|
+
$form = $payload.find('form').first() if $form.length == 0
|
67
68
|
|
68
|
-
return if
|
69
|
+
return if $form.length == 0
|
69
70
|
|
70
71
|
EffectiveBootstrap.initialize($form)
|
71
72
|
$target.replaceWith($form)
|
@@ -79,9 +80,7 @@ this.EffectiveForm ||= new class
|
|
79
80
|
@current_submit = $form.find("##{@current_submit.attr('id')}.form-actions")
|
80
81
|
|
81
82
|
if @remote_form_flash.length > 0
|
82
|
-
for flash in @remote_form_flash
|
83
|
-
@flash($form, flash[0], flash[1], true)
|
84
|
-
|
83
|
+
@flash($form, flash[0], flash[1], true) for flash in @remote_form_flash
|
85
84
|
@remote_form_flash = ''
|
86
85
|
|
87
86
|
flash: ($form, status, message, skip_success = false) ->
|
@@ -0,0 +1,7 @@
|
|
1
|
+
$(document).on 'click', '[data-effective-checks-all]', (event) ->
|
2
|
+
$(event.currentTarget).closest('.effective-checks').find('input:checkbox').prop('checked', true)
|
3
|
+
false
|
4
|
+
|
5
|
+
$(document).on 'click', '[data-effective-checks-none]', (event) ->
|
6
|
+
$(event.currentTarget).closest('.effective-checks').find('input:checkbox').prop('checked', false)
|
7
|
+
false
|
@@ -0,0 +1 @@
|
|
1
|
+
//= require ./initialize
|
@@ -48,7 +48,11 @@ module Effective
|
|
48
48
|
|
49
49
|
text = (options[:label].delete(:text) || (object.class.human_attribute_name(name) if object) || BLANK).html_safe
|
50
50
|
|
51
|
-
content_tag((inline? ? :label : :legend),
|
51
|
+
content_tag((inline? ? :label : :legend), options[:label]) do
|
52
|
+
text + content_tag(:small, class: 'effective-checks-actions text-muted ml-1') do
|
53
|
+
link_to('All', '#', 'data-effective-checks-all': true) + ' - ' + link_to('None', '#', 'data-effective-checks-none': true)
|
54
|
+
end
|
55
|
+
end
|
52
56
|
end
|
53
57
|
|
54
58
|
def build_item(builder)
|
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.0.
|
4
|
+
version: 0.0.17
|
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: 2018-05-
|
11
|
+
date: 2018-05-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -370,6 +370,8 @@ files:
|
|
370
370
|
- app/assets/javascripts/effective_bootstrap.js
|
371
371
|
- app/assets/javascripts/effective_bootstrap/base.js.coffee
|
372
372
|
- app/assets/javascripts/effective_bootstrap/form.js.coffee
|
373
|
+
- app/assets/javascripts/effective_checks/initialize.js.coffee
|
374
|
+
- app/assets/javascripts/effective_checks/input.js
|
373
375
|
- app/assets/javascripts/effective_date/initialize.js.coffee
|
374
376
|
- app/assets/javascripts/effective_date/input.js
|
375
377
|
- app/assets/javascripts/effective_datetime/bootstrap-datetimepicker.js
|