jquery-timepicker-rails 1.3.5 → 1.3.6

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: 9fd1716bf9fb44052c53d2beb071f2ba87898996
4
- data.tar.gz: b4876c48e96e8b41bf668ef6929f695d58d96096
3
+ metadata.gz: c42a8f86a2e335c9e1334379379e9eb2490d94c9
4
+ data.tar.gz: a82b7b764a3d2e4017c0053871f83d05c439ab32
5
5
  SHA512:
6
- metadata.gz: 2b862ed1f469bf4b9da10d9393bf66f3af554847431276f829c6b86277e97bfc1f1c5adde3685852170776f471309edb99d77de2527f849d4c46cb7355ffee6d
7
- data.tar.gz: 3cf0d50775de147f466954c0b804190499872f88d6a8e1d836e9931d15ab0183e0cd3f37ec62c717a0c51dc824079bd8b6ddb473ada5e89ddaa73d265fe716de
6
+ metadata.gz: 2364986133af6d352bb35a57ab5986fb2416d73ea00e76fd80c8f7eb2a1dda21950caca91d05982f4adab1e0b15aa2ace1880dab1dc2b3e372f9b76b126d9010
7
+ data.tar.gz: 9211129ad12356ff0bdb115c2a8135edca14318f0d8f90fc87c44f66e1ecf794e39a0018189b5522c1c8c691fc560e0512288a71c73eb489be90ab14cc3d2567
@@ -1,7 +1,7 @@
1
1
  module Jquery
2
2
  module Timepicker
3
3
  module Rails
4
- VERSION = "1.3.5"
4
+ VERSION = "1.3.6"
5
5
  end
6
6
  end
7
7
  end
@@ -1,5 +1,5 @@
1
1
  /************************
2
- jquery-timepicker v1.3.5
2
+ jquery-timepicker v1.3.6
3
3
  http://jonthornton.github.com/jquery-timepicker/
4
4
 
5
5
  requires jQuery 1.7+
@@ -31,12 +31,17 @@ requires jQuery 1.7+
31
31
  disableTouchKeyboard: false,
32
32
  forceRoundTime: false,
33
33
  appendTo: 'body',
34
+ orientation: 'ltr',
34
35
  disableTimeRanges: [],
35
36
  closeOnWindowScroll: false,
36
37
  typeaheadHighlight: true,
37
38
  noneOption: false
38
39
  };
39
40
  var _lang = {
41
+ am: 'am',
42
+ pm: 'pm',
43
+ AM: 'AM',
44
+ PM: 'PM',
40
45
  decimal: '.',
41
46
  mins: 'mins',
42
47
  hr: 'hr',
@@ -53,7 +58,7 @@ requires jQuery 1.7+
53
58
 
54
59
  // pick up settings from data attributes
55
60
  var attributeOptions = [];
56
- for (key in _defaults) {
61
+ for (var key in _defaults) {
57
62
  if (self.data(key)) {
58
63
  attributeOptions[key] = self.data(key);
59
64
  }
@@ -122,22 +127,28 @@ requires jQuery 1.7+
122
127
  // make sure other pickers are hidden
123
128
  methods.hide();
124
129
 
130
+ // position the dropdown relative to the input
125
131
  list.show();
132
+ var listOffset = {};
133
+
134
+ if (settings.orientation == 'rtl') {
135
+ // right-align the dropdown
136
+ listOffset.left = self.offset().left + self.outerWidth() - list.outerWidth() + parseInt(list.css('marginLeft').replace('px', ''), 10);
137
+ } else {
138
+ // left-align the dropdown
139
+ listOffset.left = self.offset().left + parseInt(list.css('marginLeft').replace('px', ''), 10);
140
+ }
126
141
 
127
142
  if ((self.offset().top + self.outerHeight(true) + list.outerHeight()) > $(window).height() + $(window).scrollTop()) {
128
143
  // position the dropdown on top
129
- list.offset({
130
- 'left': self.offset().left + parseInt(list.css('marginLeft').replace('px', ''), 10),
131
- 'top': self.offset().top - list.outerHeight() + parseInt(list.css('marginTop').replace('px', ''), 10)
132
- });
144
+ listOffset.top = self.offset().top - list.outerHeight() + parseInt(list.css('marginTop').replace('px', ''), 10);
133
145
  } else {
134
146
  // put it under the input
135
- list.offset({
136
- 'left':self.offset().left + parseInt(list.css('marginLeft').replace('px', ''), 10),
137
- 'top': self.offset().top + self.outerHeight() + parseInt(list.css('marginTop').replace('px', ''), 10)
138
- });
147
+ listOffset.top = self.offset().top + self.outerHeight() + parseInt(list.css('marginTop').replace('px', ''), 10);
139
148
  }
140
149
 
150
+ list.offset(listOffset);
151
+
141
152
  // position scrolling
142
153
  var selected = list.find('.ui-timepicker-selected');
143
154
 
@@ -623,9 +634,8 @@ requires jQuery 1.7+
623
634
  }
624
635
 
625
636
  var self = $(this);
626
- var list = self.data('timepicker-list');
627
637
 
628
- if (list && list.is(':visible')) {
638
+ if (self.is(':focus')) {
629
639
  return;
630
640
  }
631
641
 
@@ -930,11 +940,11 @@ requires jQuery 1.7+
930
940
  switch (code) {
931
941
 
932
942
  case 'a':
933
- output += (time.getHours() > 11) ? 'pm' : 'am';
943
+ output += (time.getHours() > 11) ? _lang.pm : _lang.am;
934
944
  break;
935
945
 
936
946
  case 'A':
937
- output += (time.getHours() > 11) ? 'PM' : 'AM';
947
+ output += (time.getHours() > 11) ? _lang.PM : _lang.AM;
938
948
  break;
939
949
 
940
950
  case 'g':
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jquery-timepicker-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.5
4
+ version: 1.3.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tanguy Krotoff (jQuery plugin by Jon Thornton)
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-02-25 00:00:00.000000000 Z
12
+ date: 2014-04-13 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: railties
@@ -91,7 +91,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
91
91
  version: '0'
92
92
  requirements: []
93
93
  rubyforge_project:
94
- rubygems_version: 2.2.0
94
+ rubygems_version: 2.2.2
95
95
  signing_key:
96
96
  specification_version: 4
97
97
  summary: jquery-timepicker packaged for the Rails 3.1+ asset pipeline