romo 0.20.7 → 0.20.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
- data.tar.gz: 8fbb0075b9629ae645bacca166ef68fa523d5690
4
- metadata.gz: bd75a4dad4da2f662d251850cadd631c4028f685
3
+ data.tar.gz: 31758e043ed3c723d6c1725ff75fdef87f9fee23
4
+ metadata.gz: 3c6e4f0cdcf8cf46c98f66a7aeb16360a3f6d249
5
5
  SHA512:
6
- data.tar.gz: fcb60aa1c5f6ebc6a8c6ad5d2fdf2abb37bac69eaff5d844668696f9430eb564d35dd923ff949927b2ab89470d7ff794c716c3d1ef2580f23a480544c7c4f936
7
- metadata.gz: e44331d835150aef29891eeca950843e16a5ea1c949cdd376201be56e1943e97a807592383f426786b3c2498dfc1dd610445b75dc3113ba4e6e1b2758cae7caa
6
+ data.tar.gz: 58cf33f154ebd786f8b40e98c9ffd11ea89e9fc5c5ec13b73933291cdd6ad3d3be3a846ef8272ba231bd2f205b09409741cb181c11f499c11f75e88be70c6fca
7
+ metadata.gz: 4074825312e192e72923ffc7558943d7c662d821bee65d448d5caa5f1178c7c192b7ebf766d6d9ad2cf0ed90a6434054a49f202d521debe28a4333dff6b47588
@@ -78,6 +78,12 @@ var RomoDate = {
78
78
  return RomoDate.daysInMonth(d) - d.getDate() + 1;
79
79
  },
80
80
 
81
+ daysDiff: function(firstDate, secondDate) {
82
+ var fd = RomoDate.date(firstDate);
83
+ var sd = RomoDate.date(secondDate);
84
+ return Math.round((fd.getTime() - sd.getTime()) / 864e5); // 1000 * 60 * 60 * 24
85
+ },
86
+
81
87
  isoWeekNum: function(weekDate) {
82
88
  var d = RomoDate.date(weekDate)
83
89
 
@@ -89,6 +89,9 @@ RomoDropdownForm.prototype._bindForm = function() {
89
89
  Romo.on(formElem, 'romoForm:browserSubmit', Romo.proxy(function(e, romoForm) {
90
90
  Romo.trigger(this.elem, 'romoDropdownForm:romoForm:browserSubmit', [romoForm, this]);
91
91
  }, this));
92
+ Romo.on(formElem, 'romoForm:eventSubmit', Romo.proxy(function(e, formValues, romoForm) {
93
+ Romo.trigger(this.elem, 'romoDropdownForm:romoForm:eventSubmit', [formValues, romoForm, this]);
94
+ }, this));
92
95
 
93
96
  var submitElems = Romo.find(this.romoDropdown.popupElem, '[data-romo-form-submit]');
94
97
  var spinnerElems = Romo.find(this.romoDropdown.popupElem, '[data-romo-spinner-auto="true"]');
@@ -77,19 +77,27 @@ RomoForm.prototype._submit = function() {
77
77
 
78
78
  if(Romo.data(this.elem, 'romo-form-browser-submit') === true) {
79
79
  this._browserSubmit();
80
+ } else if (Romo.data(this.elem, 'romo-form-event-submit') === true) {
81
+ this._eventSubmit();
80
82
  } else if (Romo.attr(this.elem, 'method').toUpperCase() === 'GET') {
81
- this._nonBrowserGetSubmit();
83
+ this._ajaxGetSubmit();
82
84
  } else {
83
- this._nonBrowserNonGetSubmit();
85
+ this._ajaxNonGetSubmit();
84
86
  }
85
87
  }
86
88
 
87
89
  RomoForm.prototype._browserSubmit = function() {
88
- this.elem.submit();
89
90
  Romo.trigger(this.elem, 'romoForm:browserSubmit', [this]);
91
+ this.elem.submit();
92
+ }
93
+
94
+ RomoForm.prototype._eventSubmit = function() {
95
+ var formValues = this._getFormValues({ includeFiles: true });
96
+ Romo.trigger(this.elem, 'romoForm:eventSubmit', [formValues, this]);
97
+ this._completeSubmit();
90
98
  }
91
99
 
92
- RomoForm.prototype._nonBrowserGetSubmit = function() {
100
+ RomoForm.prototype._ajaxGetSubmit = function() {
93
101
  var formValues = this._getFormValues({ includeFiles: false });
94
102
 
95
103
  if (Romo.data(this.elem, 'romo-form-redirect-page') === true) {
@@ -107,7 +115,7 @@ RomoForm.prototype._nonBrowserGetSubmit = function() {
107
115
  }
108
116
  }
109
117
 
110
- RomoForm.prototype._nonBrowserNonGetSubmit = function() {
118
+ RomoForm.prototype._ajaxNonGetSubmit = function() {
111
119
  var formValues = this._getFormValues({ includeFiles: true });
112
120
 
113
121
  this._ajaxSubmit(formValues);
@@ -85,6 +85,12 @@ RomoInlineForm.prototype._bindForm = function() {
85
85
  Romo.on(formElem, 'romoForm:submitError', Romo.proxy(function(e, xhr, romoForm) {
86
86
  Romo.trigger(this.elem, 'romoInlineForm:romoForm:submitError', [xhr, romoForm, this]);
87
87
  }, this));
88
+ Romo.on(formElem, 'romoForm:browserSubmit', Romo.proxy(function(e, romoForm) {
89
+ Romo.trigger(this.elem, 'romoInlineForm:romoForm:browserSubmit', [romoForm, this]);
90
+ }, this));
91
+ Romo.on(formElem, 'romoForm:eventSubmit', Romo.proxy(function(e, formValues, romoForm) {
92
+ Romo.trigger(this.elem, 'romoInlineForm:romoForm:eventSubmit', [formValues, romoForm, this]);
93
+ }, this));
88
94
 
89
95
  var submitElems = Romo.find(this.elem, '[data-romo-form-submit]');
90
96
  var spinnerElems = Romo.find(this.elem, '[data-romo-spinner-auto="true"]');
@@ -98,6 +98,9 @@ RomoModalForm.prototype._bindForm = function() {
98
98
  Romo.on(formElem, 'romoForm:browserSubmit', Romo.proxy(function(e, romoForm) {
99
99
  Romo.trigger(this.elem, 'romoModalForm:romoForm:browserSubmit', [romoForm, this]);
100
100
  }, this));
101
+ Romo.on(formElem, 'romoForm:eventSubmit', Romo.proxy(function(e, formValues, romoForm) {
102
+ Romo.trigger(this.elem, 'romoModalForm:romoForm:eventSubmit', [formValues, romoForm, this]);
103
+ }, this));
101
104
 
102
105
  var submitElems = Romo.find(this.romoModal.popupElem, '[data-romo-form-submit]');
103
106
  var spinnerElems = Romo.find(this.romoModal.popupElem, '[data-romo-spinner-auto="true"]');
@@ -1,3 +1,3 @@
1
1
  module Romo
2
- VERSION = "0.20.7"
2
+ VERSION = "0.20.8"
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.20.7
4
+ version: 0.20.8
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: 2017-12-12 00:00:00 Z
13
+ date: 2017-12-22 00:00:00 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: assert