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 +4 -4
- data/assets/js/romo/date.js +6 -0
- data/assets/js/romo/dropdown_form.js +3 -0
- data/assets/js/romo/form.js +13 -5
- data/assets/js/romo/inline_form.js +6 -0
- data/assets/js/romo/modal_form.js +3 -0
- data/lib/romo/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
data.tar.gz:
|
4
|
-
metadata.gz:
|
3
|
+
data.tar.gz: 31758e043ed3c723d6c1725ff75fdef87f9fee23
|
4
|
+
metadata.gz: 3c6e4f0cdcf8cf46c98f66a7aeb16360a3f6d249
|
5
5
|
SHA512:
|
6
|
-
data.tar.gz:
|
7
|
-
metadata.gz:
|
6
|
+
data.tar.gz: 58cf33f154ebd786f8b40e98c9ffd11ea89e9fc5c5ec13b73933291cdd6ad3d3be3a846ef8272ba231bd2f205b09409741cb181c11f499c11f75e88be70c6fca
|
7
|
+
metadata.gz: 4074825312e192e72923ffc7558943d7c662d821bee65d448d5caa5f1178c7c192b7ebf766d6d9ad2cf0ed90a6434054a49f202d521debe28a4333dff6b47588
|
data/assets/js/romo/date.js
CHANGED
@@ -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"]');
|
data/assets/js/romo/form.js
CHANGED
@@ -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.
|
83
|
+
this._ajaxGetSubmit();
|
82
84
|
} else {
|
83
|
-
this.
|
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.
|
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.
|
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"]');
|
data/lib/romo/version.rb
CHANGED
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.
|
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-
|
13
|
+
date: 2017-12-22 00:00:00 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: assert
|