anjlab-widgets 1.0.8 → 1.0.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +1 -1
- data/app/assets/javascripts/anjlab/datepicker.js.coffee +5 -6
- data/app/assets/javascripts/anjlab/timepicker.js.coffee +2 -2
- data/app/assets/stylesheets/anjlab/datepicker.css.scss +23 -11
- data/app/assets/stylesheets/anjlab/timepicker.css.scss +5 -5
- data/lib/anjlab-widgets/version.rb +1 -1
- data/spec/dummy/app/views/widgets/datepicker.html.erb +6 -1
- data/spec/dummy/app/views/widgets/timepicker.html.erb +7 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d6393b9f5ad7b950a29d3151d851e42540a864c9
|
4
|
+
data.tar.gz: 3f7dc68afdcfb6b1fdfabde911b05c54cfb9b7f4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 51c79a86372996f405c4eead5357977affa86799e610cdbd540c5b06b2bc9bb58c3b8118413c2c4e45bb03d907bad0d62a5f1bacc09b911157d0e16c81978613
|
7
|
+
data.tar.gz: 576185d97277e09b32b2292612dfb1a77495aa89481fc65140f5d2abc0ce156709840be65f26b703e9971632f6b7c8e0b3ee7f09e7822bda708c4d07f5fdf58b
|
data/Gemfile
CHANGED
@@ -114,9 +114,9 @@ DateTools =
|
|
114
114
|
|
115
115
|
headTemplate: '<thead>'+
|
116
116
|
'<tr>'+
|
117
|
-
'<th class="prev"><
|
117
|
+
'<th class="prev"><span class="icon-left"/></th>'+
|
118
118
|
'<th colspan="5" class="switch"></th>'+
|
119
|
-
'<th class="next"><
|
119
|
+
'<th class="next"><span class="icon-right"/></th>'+
|
120
120
|
'</tr>'+
|
121
121
|
'</thead>'
|
122
122
|
|
@@ -186,7 +186,7 @@ class Datepicker extends NativeRailsDatepicker
|
|
186
186
|
}
|
187
187
|
|
188
188
|
@isInput = @element.is('input');
|
189
|
-
@component = if @element.is('.date') then @element.find('.add-on') else false;
|
189
|
+
@component = if !@isInput && @element.is('.date') then @element.find('.add-on') else false;
|
190
190
|
|
191
191
|
if @isInput
|
192
192
|
@element.on {
|
@@ -231,7 +231,6 @@ class Datepicker extends NativeRailsDatepicker
|
|
231
231
|
@showMode()
|
232
232
|
$(document).off('mousedown', @hide) if !@isInput
|
233
233
|
|
234
|
-
@setValue()
|
235
234
|
@element.trigger
|
236
235
|
type: 'hide'
|
237
236
|
date: @date
|
@@ -240,10 +239,10 @@ class Datepicker extends NativeRailsDatepicker
|
|
240
239
|
formated = DateTools.formatDate(@date, @format)
|
241
240
|
if !@isInput
|
242
241
|
if @component
|
243
|
-
@element.find('input').
|
242
|
+
@element.find('input').val(formated).change()
|
244
243
|
@element.data('date', formated)
|
245
244
|
else
|
246
|
-
@element.
|
245
|
+
@element.val(formated).change()
|
247
246
|
|
248
247
|
place: ->
|
249
248
|
offset = if @component then @component.offset() else @element.offset()
|
@@ -84,7 +84,7 @@ class Timepicker extends NativeRailsTimepicker
|
|
84
84
|
@picker.find("a[data-time='#{@time}']").addClass('active')
|
85
85
|
|
86
86
|
setValue: ->
|
87
|
-
@element.
|
87
|
+
@element.val(@time).change()
|
88
88
|
|
89
89
|
fillTimes: ->
|
90
90
|
timeCnt = @startTime
|
@@ -130,7 +130,7 @@ class Timepicker extends NativeRailsTimepicker
|
|
130
130
|
@picker.hide()
|
131
131
|
$(window).off 'resize', @place
|
132
132
|
|
133
|
-
@setValue()
|
133
|
+
# @setValue()
|
134
134
|
@element.trigger {
|
135
135
|
type: 'hide'
|
136
136
|
date: @time
|
@@ -3,7 +3,7 @@
|
|
3
3
|
left: 0;
|
4
4
|
padding: 4px;
|
5
5
|
margin-top: 1px;
|
6
|
-
|
6
|
+
border-radius: $border-radius-base;
|
7
7
|
|
8
8
|
>div {
|
9
9
|
display: none;
|
@@ -22,45 +22,45 @@
|
|
22
22
|
th {
|
23
23
|
text-align: center;
|
24
24
|
@include square(20px);
|
25
|
-
|
25
|
+
border-radius: $border-radius-base;
|
26
26
|
}
|
27
27
|
td {
|
28
28
|
&.day:hover {
|
29
|
-
background: $
|
29
|
+
background: $gray-lighter;
|
30
30
|
cursor: pointer;
|
31
31
|
}
|
32
32
|
&.old,
|
33
33
|
&.new {
|
34
|
-
color: $
|
34
|
+
color: $gray-light;
|
35
35
|
}
|
36
36
|
&.today {
|
37
37
|
font-weight: bold;
|
38
38
|
}
|
39
39
|
&.active,
|
40
40
|
&.active:hover {
|
41
|
-
@include
|
41
|
+
@include btn-pseudo-states($btn-primary-color, $btn-primary-bg, $btn-primary-border);
|
42
42
|
color: #fff;
|
43
43
|
text-shadow: 0 -1px 0 rgba(0,0,0,.25);
|
44
44
|
}
|
45
45
|
span {
|
46
46
|
display: block;
|
47
|
-
width:
|
47
|
+
width: 54px;
|
48
48
|
height: 54px;
|
49
49
|
line-height: 54px;
|
50
50
|
float: left;
|
51
51
|
margin: 2px;
|
52
52
|
cursor: pointer;
|
53
|
-
|
53
|
+
border-radius: $border-radius-base;
|
54
54
|
&:hover {
|
55
|
-
background: $
|
55
|
+
background: $gray-lighter;
|
56
56
|
}
|
57
57
|
&.active {
|
58
|
-
@include
|
58
|
+
@include btn-pseudo-states($btn-primary-color, $btn-primary-bg, $btn-primary-border);
|
59
59
|
color: #fff;
|
60
60
|
text-shadow: 0 -1px 0 rgba(0,0,0,.25);
|
61
61
|
}
|
62
62
|
&.old {
|
63
|
-
color: $
|
63
|
+
color: $gray-light;
|
64
64
|
}
|
65
65
|
}
|
66
66
|
}
|
@@ -72,7 +72,19 @@
|
|
72
72
|
thead tr:first-child th {
|
73
73
|
cursor: pointer;
|
74
74
|
&:hover {
|
75
|
-
background: $
|
75
|
+
background: $gray-lighter;
|
76
|
+
}
|
77
|
+
}
|
78
|
+
|
79
|
+
.icon-left {
|
80
|
+
&:before {
|
81
|
+
content: '\2039';// SINGLE LEFT-POINTING ANGLE QUOTATION MARK (U+2039)
|
82
|
+
}
|
83
|
+
}
|
84
|
+
|
85
|
+
.icon-right {
|
86
|
+
&:before {
|
87
|
+
content: '\203a';// SINGLE RIGHT-POINTING ANGLE QUOTATION MARK (U+203A)
|
76
88
|
}
|
77
89
|
}
|
78
90
|
}
|
@@ -3,7 +3,7 @@
|
|
3
3
|
left: 0;
|
4
4
|
padding: 4px;
|
5
5
|
margin-top: 1px;
|
6
|
-
|
6
|
+
border-radius: $border-radius-base;
|
7
7
|
height:224px;
|
8
8
|
width:70px !important;
|
9
9
|
min-width:70px;
|
@@ -14,20 +14,20 @@
|
|
14
14
|
}
|
15
15
|
|
16
16
|
a {
|
17
|
-
|
17
|
+
border-radius: $border-radius-base;
|
18
18
|
display: block;
|
19
19
|
padding: 0 1em;
|
20
20
|
|
21
21
|
&:hover {
|
22
|
-
background: $
|
22
|
+
background: $gray-lighter;
|
23
23
|
cursor: pointer;
|
24
24
|
}
|
25
25
|
&.night {
|
26
|
-
color: $
|
26
|
+
color: $gray-light;
|
27
27
|
}
|
28
28
|
&.active,
|
29
29
|
&.active:hover {
|
30
|
-
@include
|
30
|
+
@include btn-pseudo-states($btn-primary-color, $btn-primary-bg, $btn-primary-border);
|
31
31
|
color: #fff;
|
32
32
|
text-shadow: 0 -1px 0 rgba(0,0,0,.25);
|
33
33
|
}
|
@@ -1,5 +1,5 @@
|
|
1
1
|
<input data-widget='datepicker' data-date-format='dd.mm.yyyy' value='05.08.2012'>
|
2
|
-
<input data-widget='datepicker' data-date-locale='ru'>
|
2
|
+
<input class='js-change' data-widget='datepicker' data-date-locale='ru'>
|
3
3
|
<br>
|
4
4
|
<input data-widget='datepicker' data-date-locale='en'>
|
5
5
|
<input data-widget='datepicker'>
|
@@ -7,3 +7,8 @@
|
|
7
7
|
<input data-widget='datepicker' data-date-locale='es'>
|
8
8
|
<input data-widget='datepicker' data-date-allow-blank='false'>
|
9
9
|
|
10
|
+
<script>
|
11
|
+
$('.js-change').change(function(){
|
12
|
+
console.log($('.js-change').val())
|
13
|
+
})
|
14
|
+
</script>
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: anjlab-widgets
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yury Korolev
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-08-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: anjlab-bootstrap-rails
|