anjlab-widgets 1.0.7 → 1.0.8

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: dce23c07ae07ffad959a9bdfaa5cd06d87c6acd4
4
- data.tar.gz: 9c2b951f3394d1ee02661af03eec23e3a769c6aa
3
+ metadata.gz: 1ec99f00a18ca6d9718827c73d21a1c16ac0f7f0
4
+ data.tar.gz: 3fee3300ceb57043fd3bae398c700deb8802324f
5
5
  SHA512:
6
- metadata.gz: bf80d6538c01a24730ef51b4068a16349d2bb19106d35427a07808ed68d7d50e672ddd66f55e5fb624ffb2b32a49fc88ba15f5c64d786181f96481fdf02e01e8
7
- data.tar.gz: a49971d2a010d826d56fc6b8747ba9c7f89031c7c0842189c8dde65e1acc700e59c36154a6ad7c0f694b1ddce3f5d56c6252db83e550ce8d4dc64ff3acaeb2dc
6
+ metadata.gz: 722c8309b76f2466c26dad4ece94b3e79aaa912bb83e1cd5b45ba7cd99ad3c921f095dce616514527397e1b1585d946b1236eb669f39b04f3f55857608d3fc69
7
+ data.tar.gz: 9140eeaa92907c37f0b282a5dd22e4e4acf756f71b11899328d7b83cb67511503aef8b739cfc596d1b134a214f0e5986861ecd368a0f193ff5758c658eefefec
@@ -42,10 +42,12 @@ class Timepicker extends NativeRailsTimepicker
42
42
  blur: $.proxy(@hide, this)
43
43
  }
44
44
 
45
- @step = options.step || @element.data('date-time-step') || 30
46
- @minTime = options.minTime || @element.data('date-time-min') || 9 * 60
47
- @maxTime = options.maxTime || @element.data('date-time-max') || 20 * 60
48
-
45
+ @step = options.step || @element.data('date-time-step') || 30
46
+ @startTime = options.startTime || (@element.data('date-time-start') || 0) * 60
47
+ @endTime = options.endTime || (@element.data('date-time-end') || 24) * 60
48
+ @minTime = options.minTime || (@element.data('date-time-min') || 9) * 60
49
+ @maxTime = options.maxTime || (@element.data('date-time-max') || 20) * 60
50
+
49
51
  @fillTimes()
50
52
  @update()
51
53
  @scrollPlaced = false
@@ -85,9 +87,9 @@ class Timepicker extends NativeRailsTimepicker
85
87
  @element.prop('value', @time)
86
88
 
87
89
  fillTimes: ->
88
- timeCnt = 0
90
+ timeCnt = @startTime
89
91
  html = []
90
- while timeCnt < 24 * 60
92
+ while timeCnt < @endTime
91
93
  mm = timeCnt % 60
92
94
  hh = Math.floor(timeCnt / 60)
93
95
  mm = (if mm < 10 then '0' else '') + mm
@@ -20,7 +20,7 @@ module Anjlab
20
20
  :value => Widgets::format_date(time),
21
21
  :required => input_html_options[:required],
22
22
  :class => "#{input_html_options[:date_class] || 'input-small'}"
23
- }
23
+ }.merge(input_html_options)
24
24
 
25
25
  time_data = {
26
26
  "data-widget" => "timepicker",
@@ -28,7 +28,7 @@ module Anjlab
28
28
  :value => Widgets::format_time(time),
29
29
  :required => input_html_options[:required],
30
30
  :class => "#{input_html_options[:time_class] || 'input-small'}"
31
- }
31
+ }.merge(input_html_options)
32
32
 
33
33
  case input_type
34
34
  when :datetime, :anjlab_datetime
@@ -1,5 +1,5 @@
1
1
  module Anjlab
2
2
  module Widgets
3
- VERSION = "1.0.7"
3
+ VERSION = "1.0.8"
4
4
  end
5
5
  end
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.7
4
+ version: 1.0.8
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-06-13 00:00:00.000000000 Z
11
+ date: 2013-06-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: anjlab-bootstrap-rails