data_confirm_modal 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +36 -3
- data/lib/data_confirm_modal/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4652f807e5daf4caa1b44a357fdc877b1ca745de
|
4
|
+
data.tar.gz: 7570a8d5c7e15b7659cbc84e88a2d1e2b78855cf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cf43ac45a6fd69a108394be6f6efaa7c9ded4ba0ecbd77c437df6886ccb4458b6d125feb2dfd7454a78b5df9217f908898bce6fbedc9f60bc95dc7bfdf2856f9
|
7
|
+
data.tar.gz: c0579dde7e2032c2070dfc577aab55ec759e22253c1cca9bb5923e9486fb786c766085f309db23be54a3c637cde0107a6f57128f718a9aca5ef46e1267b16910
|
data/README.md
CHANGED
@@ -23,12 +23,12 @@ Or install it yourself as:
|
|
23
23
|
## Usage
|
24
24
|
### At Present This Gem is only compatible with Foundation Framework 5+
|
25
25
|
|
26
|
-
Add to your application.js
|
26
|
+
Add to your ```application.js``` as shown below:
|
27
27
|
|
28
28
|
```ruby
|
29
29
|
//= require jquery_ujs
|
30
30
|
//= require foundation
|
31
|
-
//= require data_confirm_modal
|
31
|
+
//= require data_confirm_modal -> Must be placed below jquery-ujs aside from that it dose not have to be below foundation
|
32
32
|
```
|
33
33
|
|
34
34
|
Add the following to the bottom of the page but above ```</html>``` that contains the modal you wish to modify:
|
@@ -54,7 +54,40 @@ To force a user to type a password of your choosing to proceed with the action:
|
|
54
54
|
})
|
55
55
|
</script>
|
56
56
|
```
|
57
|
-
|
57
|
+
|
58
|
+
To add this directly to a ```link_to```, to customize one-off modals:
|
59
|
+
```ruby
|
60
|
+
<%= link_to 'some_link', your_path_here, :class => 'button', data: { confirm:
|
61
|
+
{ title: 'do you really want to do this?',
|
62
|
+
body: 'it cant be undone, not even wishing will fix-it',
|
63
|
+
prompt: 'type THIS to unlock the confirm button',
|
64
|
+
password: 'THIS',
|
65
|
+
ok: 'be gone with it',
|
66
|
+
cancel: 'I may loose my job if I do this..'
|
67
|
+
}
|
68
|
+
} %>
|
69
|
+
```
|
70
|
+
Further Customizations:
|
71
|
+
```ruby
|
72
|
+
modal_class: custom css classes for the modal handling the confirmation
|
73
|
+
|
74
|
+
title: adds a custom modal title (the default is set to Are you sure?)
|
75
|
+
title_class: add css classes for styling the title
|
76
|
+
|
77
|
+
body: adds modal body text
|
78
|
+
body_class: custom css classes for styling the body
|
79
|
+
|
80
|
+
prompt: adds type ... to continue
|
81
|
+
password: this is what the user will use to unlock the continue button.
|
82
|
+
|
83
|
+
footer_class: custom css classes to style modal footer
|
84
|
+
|
85
|
+
ok: set the text to appear inside confirm button
|
86
|
+
ok_class: style the ok button and text with custom css
|
87
|
+
|
88
|
+
cancel: set the text to appear inside the cancel button
|
89
|
+
cancel_class: style the cancel button and text with custom css
|
90
|
+
```
|
58
91
|
|
59
92
|
## Contributing
|
60
93
|
|