verne 0.3.0 → 0.4.0
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/verne.dropdown.js.coffee +13 -11
- data/app/assets/javascripts/verne.modal.js.coffee +52 -47
- data/app/assets/stylesheets/_verne.sass +2 -4
- data/app/assets/stylesheets/verne/_button.sass +2 -4
- data/app/assets/stylesheets/verne/_dropdown.sass +54 -52
- data/app/assets/stylesheets/verne/_form.sass +0 -160
- data/app/assets/stylesheets/verne/_modal.sass +5 -8
- data/app/assets/stylesheets/verne/_typography.sass +29 -33
- data/lib/verne/version.rb +1 -1
- metadata +1 -3
- data/app/assets/javascripts/verne.form.js.coffee +0 -18
- data/app/assets/javascripts/verne.js.coffee +0 -32
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1e7a8baa789ed7867f23a5e75ff7fc431bd0aca9
|
4
|
+
data.tar.gz: a83602cbc600d1e7db066bd178a81cd27b544b55
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1f426a0348ab8966371d92fc68697fc431e24d67c58fa20c617537ebc26a3f67d3f79d2fb14cc47c6ceadad135d742684d420f044f90cd943129b104f36f950a
|
7
|
+
data.tar.gz: cbc4bd3cc48ac5276e14b1049bdf3902e1efa273d49494f86c0844d4e8700467c5cda634de1dbec009db9d4e380bc84c95c118dd1eb853b2e39512087f631b3a
|
@@ -1,23 +1,25 @@
|
|
1
|
-
|
2
|
-
count = $("
|
3
|
-
$("ul
|
1
|
+
hideDropdowns = ->
|
2
|
+
count = $("[data-type=dropdown][data-state=open]").length
|
3
|
+
$("[data-type=dropdown] ul").fadeOut(100)
|
4
|
+
$("[data-type=dropdown]").data("state", "")
|
4
5
|
!count
|
5
6
|
|
6
7
|
$ ->
|
7
8
|
$(document).mouseup (e) ->
|
8
|
-
container = $("dropdown
|
9
|
+
container = $("[data-type=dropdown]")
|
9
10
|
if (container.has(e.target).length == 0)
|
10
|
-
|
11
|
+
hideDropdowns()
|
11
12
|
|
12
|
-
$(window).resize ->
|
13
|
+
$(window).resize -> hideDropdowns()
|
13
14
|
|
14
15
|
$("[data-toggle=dropdown]").click ->
|
15
|
-
if $(this).
|
16
|
-
|
16
|
+
if $(this).parent().data("state") == "open"
|
17
|
+
hideDropdowns()
|
17
18
|
else
|
18
|
-
|
19
|
-
dropdown = $(this).siblings
|
20
|
-
dropdown.fadeIn
|
19
|
+
hideDropdowns()
|
20
|
+
dropdown = $(this).siblings "ul"
|
21
|
+
dropdown.fadeIn 100
|
22
|
+
$(this).parent().data "state", "open"
|
21
23
|
offset = ($(this).outerWidth(false) - $(dropdown).outerWidth(false)) / 2
|
22
24
|
dropdown.css { 'margin-left' : offset + "px"}
|
23
25
|
false
|
@@ -1,55 +1,60 @@
|
|
1
|
-
|
2
|
-
$(
|
3
|
-
|
4
|
-
$.rails.toggleModal(target)
|
5
|
-
|
6
|
-
$.rails.toggleModal = (target) ->
|
7
|
-
target.toggleClass("active")
|
8
|
-
if target.hasClass("active")
|
9
|
-
overlay = $("<div class=\"overlay\"></div>")
|
10
|
-
target.appendTo(overlay)
|
11
|
-
$("body").append(overlay)
|
12
|
-
else
|
1
|
+
toggleModal = (target) ->
|
2
|
+
if $(target).data("state") == "open"
|
3
|
+
$(target).data "state", ""
|
13
4
|
target.parent().remove()
|
14
5
|
$("body").append(target)
|
6
|
+
else
|
7
|
+
$(target).data "state", "open"
|
8
|
+
overlay = $("<div data-type=\"modal\"></div>")
|
9
|
+
target.appendTo(overlay)
|
10
|
+
$("body").append(overlay)
|
11
|
+
|
12
|
+
$ ->
|
13
|
+
$(document).on "click", "[data-toggle=modal]", ->
|
14
|
+
target = $($(this).attr("data-target"))
|
15
|
+
toggleModal(target)
|
15
16
|
|
16
|
-
$.rails.allowAction = (link) ->
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
17
|
+
# $.rails.allowAction = (link) ->
|
18
|
+
# return true unless link.attr('data-confirm')
|
19
|
+
# $.rails.hideDropdowns()
|
20
|
+
# $.rails.showConfirmDialog(link)
|
21
|
+
# false # Always stops the action since code runs asynchronously
|
21
22
|
|
22
|
-
$.rails.confirmed = (link, should_continue) ->
|
23
|
+
# $.rails.confirmed = (link, should_continue) ->
|
23
24
|
|
24
|
-
|
25
|
-
|
25
|
+
# $('.overlay').fadeOut 300, ->
|
26
|
+
# $(this).remove()
|
26
27
|
|
27
|
-
|
28
|
-
|
29
|
-
|
28
|
+
# if should_continue
|
29
|
+
# link.removeAttr('data-confirm')
|
30
|
+
# link.trigger('click.rails')
|
30
31
|
|
31
|
-
$.rails.showConfirmDialog = (link) ->
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
32
|
+
# $.rails.showConfirmDialog = (link) ->
|
33
|
+
# message = link.attr 'data-confirm'
|
34
|
+
# header = "Notice"
|
35
|
+
# html = """
|
36
|
+
# <div class="overlay">
|
37
|
+
# <div class="modal-wrapper">
|
38
|
+
# <div class="modal">
|
39
|
+
# <h2>#{ header }</h2>
|
40
|
+
# <div class="content">
|
41
|
+
# <p>#{ message }</p>
|
42
|
+
# </div>
|
43
|
+
# <div class="toolbar">
|
44
|
+
# <a href="#" class="button" data-action="cancel">Cancel</a>
|
45
|
+
# <a href="#" class="button" data-action="continue">Continue</a>
|
46
|
+
# </div>
|
47
|
+
# </div>
|
48
|
+
# </div>
|
49
|
+
# </div>
|
50
|
+
# """
|
51
|
+
# $("body").append(html)
|
52
|
+
# $('.overlay a').on 'click', (event) ->
|
53
|
+
# event.preventDefault()
|
54
|
+
# should_continue = $(this).attr("data-action") == "continue"
|
55
|
+
# $.rails.confirmed(link, should_continue)
|
51
56
|
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
57
|
+
# (($) ->
|
58
|
+
# $.fn.modal = ->
|
59
|
+
# $.rails.toggleModal(this)
|
60
|
+
# ) jQuery
|
@@ -1,6 +1,3 @@
|
|
1
|
-
// Settings
|
2
|
-
$offset: 0
|
3
|
-
|
4
1
|
// Mixins
|
5
2
|
@mixin button-is-colored($color)
|
6
3
|
@include box-shadow(0 0 0 1px $color)
|
@@ -23,7 +20,7 @@ $offset: 0
|
|
23
20
|
bottom: $rhythm * 2
|
24
21
|
left: $rhythm * 3
|
25
22
|
right: $rhythm * 3
|
26
|
-
margin: 0
|
23
|
+
margin: 0
|
27
24
|
outline: none
|
28
25
|
display: inline-block
|
29
26
|
border: none
|
@@ -31,6 +28,7 @@ $offset: 0
|
|
31
28
|
border-radius: $border-radius
|
32
29
|
cursor: pointer
|
33
30
|
position: relative
|
31
|
+
background: transparent
|
34
32
|
-webkit-appearance: none
|
35
33
|
@include button-is-colored($primary-color)
|
36
34
|
|
@@ -1,59 +1,61 @@
|
|
1
1
|
$dropdown-border-color: rgba(0, 0, 0, 0.4)
|
2
2
|
|
3
|
-
|
3
|
+
%dropdown
|
4
4
|
position: relative
|
5
5
|
display: inline-block
|
6
|
-
|
7
|
-
|
8
|
-
display: none
|
9
|
-
position: absolute
|
10
|
-
background: white
|
11
|
-
list-style: none
|
12
|
-
margin: $rhythm 0 0 0
|
13
|
-
padding: 0
|
14
|
-
border: 1px solid $dropdown-border-color
|
15
|
-
background: white
|
16
|
-
left: 0
|
17
|
-
top: 100%
|
18
|
-
z-index: 1000
|
19
|
-
border-radius: 3px
|
20
|
-
box-shadow: 0px 0px $rhythm rgba(0, 0, 0, 0.2)
|
21
|
-
|
22
|
-
&:after
|
23
|
-
content: " "
|
6
|
+
ul
|
7
|
+
display: none
|
24
8
|
position: absolute
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
9
|
+
background: white
|
10
|
+
margin: $rhythm / 2 0 0 0
|
11
|
+
padding: 0
|
12
|
+
border: 1px solid $dropdown-border-color
|
13
|
+
background: white
|
14
|
+
left: 0
|
15
|
+
top: 100%
|
16
|
+
z-index: 1000
|
17
|
+
border-radius: $rhythm / 2
|
18
|
+
box-shadow: 0px 0px $rhythm rgba(0, 0, 0, 0.1)
|
31
19
|
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
20
|
+
&:after
|
21
|
+
content: " "
|
22
|
+
position: absolute
|
23
|
+
width: 0
|
24
|
+
border: $rhythm solid transparent
|
25
|
+
border-bottom-color: white
|
26
|
+
bottom: 100%
|
27
|
+
left: 50%
|
28
|
+
margin-left: - $rhythm
|
29
|
+
|
30
|
+
&:before
|
31
|
+
content: " "
|
32
|
+
position: absolute
|
33
|
+
width: 0
|
34
|
+
border: $rhythm * 1.25 solid transparent
|
35
|
+
border-bottom-color: $dropdown-border-color
|
36
|
+
bottom: 100%
|
37
|
+
left: 50%
|
38
|
+
margin-left: - ($rhythm * 1.25)
|
41
39
|
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
40
|
+
li
|
41
|
+
margin: 0
|
42
|
+
padding: 0
|
43
|
+
&:before, &:after
|
44
|
+
display: none
|
45
|
+
a
|
46
|
+
cursor: pointer
|
47
|
+
white-space: nowrap
|
48
|
+
text-align: center
|
49
|
+
display: block
|
50
|
+
margin: 0
|
51
|
+
padding: $rhythm / 2 $rhythm * 2
|
52
|
+
color: black
|
53
|
+
transition: 0.1s all linear
|
54
|
+
width: 100%
|
55
|
+
border-bottom: none
|
56
|
+
&:hover
|
57
|
+
background: rgba(0, 0, 0, 0.08)
|
58
|
+
li:first-child a
|
59
|
+
border-radius: $rhythm / 2 $rhythm / 2 0 0
|
60
|
+
li:last-child a
|
61
|
+
border-radius: 0 0 $rhythm / 2 $rhythm / 2
|
@@ -109,163 +109,3 @@ $border-width: 1px
|
|
109
109
|
color: rgba(255, 255, 255, 1.0)
|
110
110
|
&::-webkit-input-placeholder
|
111
111
|
color: rgba(255, 255, 255, 0.7)
|
112
|
-
|
113
|
-
.form-old
|
114
|
-
.input.file
|
115
|
-
.input-wrapper
|
116
|
-
width: 100%
|
117
|
-
// .input.checkbox, .input.boolean
|
118
|
-
// position: relative
|
119
|
-
// overflow: hidden
|
120
|
-
// label
|
121
|
-
// margin-left: $checkbox-size + $rhythm * 2
|
122
|
-
// line-height: $checkbox-size
|
123
|
-
// .input-wrapper
|
124
|
-
// position: absolute
|
125
|
-
// top: 0
|
126
|
-
// left: 0
|
127
|
-
// margin-left: 0
|
128
|
-
// width: $checkbox-size
|
129
|
-
// height: $checkbox-size
|
130
|
-
// border: $border-radius $highlight-color solid
|
131
|
-
// border-radius: $border-radius
|
132
|
-
// margin-bottom: $rhythm
|
133
|
-
// text-align: center
|
134
|
-
// &.checked
|
135
|
-
// border-color: $emrald
|
136
|
-
// color: $emrald
|
137
|
-
// &:after
|
138
|
-
// @include ss-standard
|
139
|
-
// content: "check"
|
140
|
-
// position: absolute
|
141
|
-
// top: -1px
|
142
|
-
// left: 0
|
143
|
-
// right: 0
|
144
|
-
// bottom: 0
|
145
|
-
// line-height: $checkbox-size
|
146
|
-
// pointer-events: none
|
147
|
-
// input
|
148
|
-
// margin: 0
|
149
|
-
// padding: 0
|
150
|
-
// cursor: pointer
|
151
|
-
// width: 100%
|
152
|
-
// height: 100%
|
153
|
-
// opacity: 0
|
154
|
-
|
155
|
-
|
156
|
-
// span.required, span.error
|
157
|
-
// top: - $line-height * 0.1
|
158
|
-
// position: relative
|
159
|
-
// font-family: $secondary-font-family
|
160
|
-
// background: $highlight-color
|
161
|
-
// border-radius: 2px
|
162
|
-
// color: white
|
163
|
-
// display: inline-block
|
164
|
-
// line-height: $line-height * 0.7
|
165
|
-
// font-size: $secondary-font-size * 0.7
|
166
|
-
// font-weight: bold
|
167
|
-
// text-transform: uppercase
|
168
|
-
// padding: 0 $line-height * 0.2
|
169
|
-
// margin: 0
|
170
|
-
// margin-right: $line-height * 0.2
|
171
|
-
// .input &
|
172
|
-
// margin-left: $line-height * 0.2
|
173
|
-
|
174
|
-
// form
|
175
|
-
// span.hint
|
176
|
-
// display: block
|
177
|
-
// font-family: $secondary-font-family
|
178
|
-
// line-height: $line-height
|
179
|
-
|
180
|
-
// .input
|
181
|
-
// position: relative
|
182
|
-
// margin-bottom: $line-height
|
183
|
-
// overflow: hidden
|
184
|
-
|
185
|
-
// &.hidden
|
186
|
-
// margin: 0
|
187
|
-
|
188
|
-
// &.date
|
189
|
-
// margin-right: $line-height
|
190
|
-
// label
|
191
|
-
// margin-left: $line-height
|
192
|
-
// > .input_wrapper > .select_wrapper
|
193
|
-
// @include span-columns(4)
|
194
|
-
// select
|
195
|
-
// width: 100%
|
196
|
-
// margin: 0
|
197
|
-
|
198
|
-
// > label.control-label
|
199
|
-
// display: inline-block
|
200
|
-
// margin-bottom: $line-height * 0.5
|
201
|
-
// text-align: left
|
202
|
-
|
203
|
-
// > .input_wrapper
|
204
|
-
// > .select_wrapper
|
205
|
-
// position: relative
|
206
|
-
// overflow: hidden
|
207
|
-
// &:after
|
208
|
-
// content: "descend"
|
209
|
-
// position: absolute
|
210
|
-
// top: 2px
|
211
|
-
// line-height: $line-height * 2
|
212
|
-
// font-size: $font-size * 0.7
|
213
|
-
// bottom: $line-height
|
214
|
-
// color: rgba(0, 0, 0, 0.3)
|
215
|
-
// right: $line-height * 0.5
|
216
|
-
// z-index: 1000
|
217
|
-
// select
|
218
|
-
// width: 100%
|
219
|
-
// display: block
|
220
|
-
// height: $line-height * 2.0
|
221
|
-
// padding: $line-height * 0.5
|
222
|
-
// border: none
|
223
|
-
// border-bottom: 3px solid rgba(0, 0, 0, 0.4)
|
224
|
-
// background: rgba(0, 0, 0, 0.07)
|
225
|
-
// outline: none
|
226
|
-
// box-sizing: border-box
|
227
|
-
// -webkit-appearance: none
|
228
|
-
// border-radius: 0
|
229
|
-
// position: relative
|
230
|
-
|
231
|
-
// > input, > textarea
|
232
|
-
// display: block
|
233
|
-
// height: $line-height * 2.0
|
234
|
-
// padding: $line-height * 0.5
|
235
|
-
// width: 100%
|
236
|
-
// border: none
|
237
|
-
// border-bottom: 3px solid rgba(0, 0, 0, 0.2)
|
238
|
-
// background: rgba(0, 0, 0, 0.07)
|
239
|
-
// outline: none
|
240
|
-
// resize: none
|
241
|
-
// box-sizing: border-box
|
242
|
-
|
243
|
-
// > textarea
|
244
|
-
// height: $line-height * 8.0
|
245
|
-
|
246
|
-
|
247
|
-
// &.check_boxes, &.radio_buttons, &.boolean
|
248
|
-
// > label.control-label
|
249
|
-
// margin-left: $line-height
|
250
|
-
// margin-right: $line-height
|
251
|
-
// user-select: none
|
252
|
-
// -webkit-user-select: none
|
253
|
-
// label.checkbox, label.radio
|
254
|
-
// @include span-columns(6)
|
255
|
-
// background: rgba(0, 0, 0, 0.05)
|
256
|
-
// display: block
|
257
|
-
// line-height: $line-height
|
258
|
-
// text-align: left
|
259
|
-
// padding: $line-height * 0.5
|
260
|
-
// box-sizing: border-box
|
261
|
-
// border-bottom: 3px solid rgba(0, 0, 0, 0.2)
|
262
|
-
// margin-bottom: $line-height
|
263
|
-
// font-weight: 400
|
264
|
-
// &:hover
|
265
|
-
// cursor: pointer
|
266
|
-
// &.selected
|
267
|
-
// background: $highlight-color
|
268
|
-
// border-bottom-color: $highlight-color
|
269
|
-
// font-weight: 700
|
270
|
-
// input
|
271
|
-
// display: none
|
@@ -1,7 +1,4 @@
|
|
1
|
-
|
2
|
-
display: none
|
3
|
-
|
4
|
-
.overlay
|
1
|
+
%modal
|
5
2
|
position: fixed
|
6
3
|
width: auto
|
7
4
|
height: auto
|
@@ -21,9 +18,9 @@
|
|
21
18
|
height: 100%
|
22
19
|
vertical-align: middle
|
23
20
|
|
24
|
-
|
21
|
+
> div
|
25
22
|
text-align: left
|
26
|
-
display: inline-block
|
23
|
+
display: inline-block !important
|
27
24
|
vertical-align: middle
|
28
25
|
box-shadow: 0 0 $rhythm rgba(0, 0, 0, 0.3)
|
29
26
|
border-radius: $border-radius
|
@@ -34,12 +31,12 @@
|
|
34
31
|
overflow: hidden
|
35
32
|
h2
|
36
33
|
margin-bottom: $rhythm * 3
|
37
|
-
|
34
|
+
> div:nth-child(1)
|
38
35
|
text-align: right
|
39
36
|
padding-top: $rhythm * 3
|
40
37
|
.button
|
41
38
|
display: inline-block
|
42
39
|
margin: 0 0 0 $rhythm
|
43
|
-
|
40
|
+
> div:nth-child(2)
|
44
41
|
max-height: $rhythm * 64
|
45
42
|
overflow: scroll
|
@@ -38,41 +38,37 @@
|
|
38
38
|
font-size: golden-ratio($rhythm * 3, 0)
|
39
39
|
font-weight: 700
|
40
40
|
|
41
|
-
|
42
|
-
|
43
|
-
font-size:
|
41
|
+
%cite
|
42
|
+
line-height: $rhythm * 3
|
43
|
+
font-size: $rhythm * 3 / 1.5 // 12px
|
44
|
+
text-transform: uppercase
|
45
|
+
display: block
|
46
|
+
font-style: normal
|
47
|
+
font-weight: 600
|
48
|
+
|
49
|
+
%a
|
50
|
+
color: $highlight-color
|
51
|
+
text-decoration: none
|
52
|
+
border-bottom: 1px solid $highlight-color
|
44
53
|
|
45
|
-
|
46
|
-
|
47
|
-
// font-weight: 600
|
54
|
+
%bold
|
55
|
+
font-weight: 600
|
48
56
|
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
57
|
+
%block-quote
|
58
|
+
@extend %copy
|
59
|
+
@extend %copy-is-large
|
60
|
+
border-left: $rhythm solid $highlight-color
|
61
|
+
font-weight: 300
|
62
|
+
display: block
|
63
|
+
margin: 0 0 $rhythm * 2 0
|
64
|
+
padding:
|
65
|
+
top: $rhythm * 2
|
66
|
+
bottom: $rhythm * 2
|
67
|
+
left: $rhythm * 4
|
68
|
+
right: $rhythm * 12
|
53
69
|
|
54
|
-
//
|
55
|
-
|
56
|
-
|
57
|
-
// text-transform: uppercase
|
58
|
-
// display: block
|
59
|
-
// font-style: normal
|
60
|
-
// font-weight: 600
|
70
|
+
// Modifiers
|
71
|
+
%copy-is-large
|
72
|
+
font-size: golden-ratio($rhythm * 3, 1)
|
61
73
|
|
62
|
-
// p, li
|
63
|
-
// margin-bottom: $rhythm * 2
|
64
74
|
|
65
|
-
// blockquote, q
|
66
|
-
// color: $primary-color
|
67
|
-
// $offset: $rhythm / 2
|
68
|
-
// font-size: ($rhythm * 5) * 0.8 // 24px
|
69
|
-
// border-left: $rhythm solid $highlight-color
|
70
|
-
// font-style: italic
|
71
|
-
// font-weight: 300
|
72
|
-
// display: block
|
73
|
-
// margin: 0 0 $rhythm * 2 0
|
74
|
-
// padding:
|
75
|
-
// top: $rhythm * 2 + $offset
|
76
|
-
// bottom: $rhythm * 3 - $offset
|
77
|
-
// left: $rhythm * 4
|
78
|
-
// right: $rhythm * 12
|
data/lib/verne/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: verne
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Devon Tivona
|
@@ -63,8 +63,6 @@ files:
|
|
63
63
|
- LICENSE
|
64
64
|
- README.md
|
65
65
|
- app/assets/javascripts/verne.dropdown.js.coffee
|
66
|
-
- app/assets/javascripts/verne.form.js.coffee
|
67
|
-
- app/assets/javascripts/verne.js.coffee
|
68
66
|
- app/assets/javascripts/verne.modal.js.coffee
|
69
67
|
- app/assets/stylesheets/_verne.sass
|
70
68
|
- app/assets/stylesheets/verne/_alert.sass
|
@@ -1,18 +0,0 @@
|
|
1
|
-
$ ->
|
2
|
-
$("input[type=checkbox]").each ->
|
3
|
-
$(this).click (event) ->
|
4
|
-
$(this).parent().toggleClass("checked")
|
5
|
-
|
6
|
-
$("input[type=file]").each ->
|
7
|
-
cancel = $("<div>", { class: "input-wrapper", text: "Remove File" })
|
8
|
-
file = $(this)
|
9
|
-
cancel.click (event) ->
|
10
|
-
file.val("")
|
11
|
-
file.parent().toggleClass("hidden")
|
12
|
-
cancel.remove()
|
13
|
-
file.parent().prepend("Upload File")
|
14
|
-
file.change (event) ->
|
15
|
-
if file.val() != ""
|
16
|
-
file.parent().toggleClass("hidden")
|
17
|
-
cancel.insertAfter(file.parent())
|
18
|
-
|
@@ -1,32 +0,0 @@
|
|
1
|
-
configureCheckbox = (checkbox) ->
|
2
|
-
if checkbox.is(':checked')
|
3
|
-
checkbox.parent().addClass("selected")
|
4
|
-
else
|
5
|
-
checkbox.parent().removeClass("selected")
|
6
|
-
|
7
|
-
$ ->
|
8
|
-
# Make rows of tables selectable
|
9
|
-
$("tr[data-target]").click(->
|
10
|
-
Turbolinks.visit $(this).attr("data-target")
|
11
|
-
).find("a").hover (->
|
12
|
-
$(this).parents("tr").unbind "click"
|
13
|
-
), ->
|
14
|
-
$(this).parents("tr").click ->
|
15
|
-
Turbolinks.visit $(this).attr("data-target")
|
16
|
-
|
17
|
-
# Add selection states to radio buttons
|
18
|
-
$("input[type=radio]").each ->
|
19
|
-
if $(this).is(':checked')
|
20
|
-
$(this).parent().addClass("selected")
|
21
|
-
$("input[type=radio]").change ->
|
22
|
-
selected = $(this)
|
23
|
-
$('input[type=radio][name="' + selected.attr('name') + '"]').each ->
|
24
|
-
if $(this).attr('id') != selected.attr('id')
|
25
|
-
$(this).parent().removeClass("selected")
|
26
|
-
selected.parent().addClass("selected")
|
27
|
-
|
28
|
-
# Add selection states to check boxes
|
29
|
-
$('input[type=checkbox]').each ->
|
30
|
-
configureCheckbox $(this)
|
31
|
-
$('input[type=checkbox]').change ->
|
32
|
-
configureCheckbox $(this)
|