semantic-rails-ui 0.0.10 → 0.0.11
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ed3b17e1d0df406452bb994361d2a986dbbde4af
|
4
|
+
data.tar.gz: 4d139c2fbcc4789659a4526417553e64ba9fb2cc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c7030b4851033cb5a7945eeda3fd70908f305121e960acc6b57cd4825823031ccc18926c383674a141113702e1fafd113e8f6eed5f8be63b34b29497f89a2fd7
|
7
|
+
data.tar.gz: ef23e23bc181bade850a74226bf8857f71dcd91cc2c661ac92c836134c6425daaaaf76386af1516ce6c2662c8ab69cf257553599375d28881d79dd2af08aa2c8
|
@@ -1,23 +1,34 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
<
|
12
|
-
|
13
|
-
|
1
|
+
$(document).bind 'confirm', (event) ->
|
2
|
+
element = $(event.target)
|
3
|
+
message = element.data("confirm")
|
4
|
+
title = element.data("confirm-title")
|
5
|
+
confirm_dialog = """
|
6
|
+
<div class="ui-confirm-dialog ui small modal">
|
7
|
+
<div class="header">#{title}</div>
|
8
|
+
<div class="content">#{message}</div>
|
9
|
+
<div class="actions">
|
10
|
+
<div class="ui red basic cancel button">
|
11
|
+
<i class="remove icon"></i>No
|
12
|
+
</div>
|
13
|
+
<div class="ui green ok button">
|
14
|
+
<i class="checkmark icon"></i>Yes
|
14
15
|
</div>
|
15
16
|
</div>
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
17
|
+
</div>
|
18
|
+
"""
|
19
|
+
# remove old confirm dialog from the body
|
20
|
+
$('.ui-confirm-dialog').parent().remove()
|
21
|
+
# attach new confirm dialog to the body
|
22
|
+
$('body').append(confirm_dialog)
|
23
|
+
$('.ui-confirm-dialog').modal(
|
24
|
+
closable: false
|
25
|
+
duration: 100
|
26
|
+
transition: 'fade'
|
27
|
+
onApprove: ->
|
28
|
+
# remove data-confirm
|
29
|
+
element.data 'confirm', null
|
30
|
+
# re-click link
|
31
|
+
element.trigger 'click.rails'
|
32
|
+
).modal('show')
|
33
|
+
# Prevent rails from popping up a browser box, we've already done the work
|
34
|
+
return false
|
@@ -1,2 +1 @@
|
|
1
|
-
|
2
|
-
$('.message .close').on 'click', -> $(this).closest('.message').transition('fade')
|
1
|
+
$('.message .close').bind 'click', -> $(this).closest('.message').transition('fade')
|
@@ -30,14 +30,14 @@ module SemanticRailsUi
|
|
30
30
|
content_tag(:i, '', class: "#{icon_name} icon")
|
31
31
|
end
|
32
32
|
|
33
|
-
def ui_delete_link(text, url, message)
|
33
|
+
def ui_delete_link(title, text, url, message)
|
34
34
|
if text == nil
|
35
35
|
text = ''
|
36
36
|
css_class = "ui red tiny compact link button"
|
37
37
|
else
|
38
38
|
css_class = "ui red tiny compact basic button"
|
39
39
|
end
|
40
|
-
link_to url, class: css_class, method: :delete, data: { confirm: message } do
|
40
|
+
link_to url, class: css_class, method: :delete, data: { confirm: message, 'confirm-title' => title } do
|
41
41
|
ui_icon("remove link") + text
|
42
42
|
end
|
43
43
|
end
|