romo 0.15.3 → 0.15.4

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
- SHA1:
3
- data.tar.gz: b0d0f892737a881b31bd74afa17b14d919d85415
4
- metadata.gz: 72c961abe361092ecbf36c423665529691e99b64
5
2
  SHA512:
6
- data.tar.gz: fc44eb83c0e0c0e9cdb43fe74b47e38ff15f708cb4e7ca6821c8ec81ef0ebb40a5d3773564ec923966342c9042549c4d5622fa75e4ae1e01d45c9559af6681de
7
- metadata.gz: 9488f9792e0fd7491c778c0ded1e377ed47a3f4a6e58ac6e2632a02e276cddfdb28a59de102acc65cceb2c9eac854df200622b1802a8745fc345729735da4b86
3
+ data.tar.gz: 4935a1e5b786db25df2d67db0b81ee2ecc94ee0bbde4a9831f04875cb72f87ac723b6c7e6d23c11c85da2b323bc3e2cd6d380a884481d6db03a478caeac603ec
4
+ metadata.gz: 7b0f0228393fce7a60947fed9b840b10facfa4b196bca6944a050315e5eccfc72bb5932877ba9eb55b6ed340134b5019506bc63d2e330c1bfca43f47d1292cbc
5
+ SHA1:
6
+ data.tar.gz: 1ad8d86e1f7d5c5c0f333c15b3b59d8e119df190
7
+ metadata.gz: 829c96298ed60801e3015eeade8d364171c2a0e2
@@ -11,13 +11,14 @@ var RomoDatepicker = function(element) {
11
11
  "January", "February", "March", "April", "May", "June",
12
12
  "July", "August", "September", "October", "November", "December"
13
13
  ]
14
- this.defaultPrevClass = undefined;
15
- this.defaultNextClass = undefined;
16
- this.defaultIndicatorClass = undefined;
17
- this.itemSelector = 'TD.romo-datepicker-day:not(.disabled)';
18
- this.calTable = $();
19
- this.date = undefined;
20
- this.today = new Date;
14
+ this.defaultPrevClass = undefined;
15
+ this.defaultNextClass = undefined;
16
+ this.defaultIndicatorClass = undefined;
17
+ this.itemSelector = 'TD.romo-datepicker-day:not(.disabled)';
18
+ this.calTable = $();
19
+ this.date = undefined;
20
+ this.today = new Date;
21
+ this.prevValue = undefined;
21
22
 
22
23
  this.doInit();
23
24
  this.doBindElem();
@@ -67,12 +68,23 @@ RomoDatepicker.prototype.doBindElem = function() {
67
68
  this.elem.after(this.indicatorElem);
68
69
  }
69
70
 
71
+ this.prevValue = this.elem.val();
72
+ this.elem.on('change', $.proxy(function(e) {
73
+ var newValue = this.elem.val();
74
+ this.elem.trigger('datepicker:change', [newValue, this.prevValue, this]);
75
+ this.prevValue = newValue;
76
+ }, this));
77
+
70
78
  this.elem.on('datepicker:triggerEnable', $.proxy(function(e) {
71
79
  this.doEnable();
72
80
  }, this));
73
81
  this.elem.on('datepicker:triggerDisable', $.proxy(function(e) {
74
82
  this.doDisable();
75
83
  }, this));
84
+ this.elem.on('datepicker:triggerSetFormat', $.proxy(function(e) {
85
+ this.doSetFormat();
86
+ }, this));
87
+ this.elem.on('datepicker:triggerSetDate', $.proxy(this.onTriggerSetDate, this));
76
88
  }
77
89
 
78
90
  RomoDatepicker.prototype.doSetFormat = function() {
@@ -195,18 +207,18 @@ RomoDatepicker.prototype.doRefreshToNextMonth = function() {
195
207
  }
196
208
 
197
209
  RomoDatepicker.prototype.doSelectHighlightedItem = function() {
198
- var prevValue = this.elem.val();
199
- var newValue = this.calTable.find('TD.romo-datepicker-highlight').data('romo-datepicker-value');
210
+ var newValue = this.calTable.find('TD.romo-datepicker-highlight').data('romo-datepicker-value');
200
211
 
201
212
  this.romoDropdown.doPopupClose();
202
213
  this.doSetDate(newValue);
203
214
  this.elem.focus();
204
- this.elem.trigger('datepicker:itemSelected', [newValue, prevValue, this]);
215
+ this.elem.trigger('datepicker:itemSelected', [newValue, this.prevValue, this]);
216
+ this._triggerSetDateChangeEvent();
217
+ }
205
218
 
206
- if (newValue !== prevValue) {
207
- this.elem.trigger('change');
208
- this.elem.trigger('datepicker:change', [newValue, prevValue, this]);
209
- }
219
+ RomoDatepicker.prototype.onTriggerSetDate = function(e, value) {
220
+ this.doSetDate(value);
221
+ this._triggerSetDateChangeEvent();
210
222
  }
211
223
 
212
224
  RomoDatepicker.prototype.onElemKeyDown = function(e) {
@@ -292,6 +304,14 @@ RomoDatepicker.prototype.onPopupMouseUp = function(e) {
292
304
  this.popupMouseDown = false;
293
305
  }
294
306
 
307
+ // private
308
+
309
+ RomoDatepicker.prototype._triggerSetDateChangeEvent = function() {
310
+ if (this.elem.val() !== this.prevValue) {
311
+ this.elem.trigger('change');
312
+ }
313
+ }
314
+
295
315
  RomoDatepicker.prototype._clearBlurTimeout = function() {
296
316
  if (this.blurTimeoutId !== undefined) {
297
317
  clearTimeout(this.blurTimeoutId);
data/lib/romo/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Romo
2
- VERSION = "0.15.3"
2
+ VERSION = "0.15.4"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: romo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.15.3
4
+ version: 0.15.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kelly Redding
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2016-02-10 00:00:00 Z
13
+ date: 2016-02-16 00:00:00 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: assert