@osimatic/helpers-js 1.0.73 → 1.0.74
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.
- package/form_helper.js +7 -6
- package/import_from_csv.js +5 -5
- package/media.js +7 -8
- package/package.json +1 -1
package/form_helper.js
CHANGED
|
@@ -200,11 +200,12 @@ class FormHelper {
|
|
|
200
200
|
static displayFormErrors(form, btnSubmit, errors, errorWrapperDiv) {
|
|
201
201
|
this.displayFormErrorsFromText(form, this.getFormErrorText(errors), errorWrapperDiv);
|
|
202
202
|
if (btnSubmit != null) {
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
203
|
+
FormHelper.buttonLoader(btnSubmit, 'reset');
|
|
204
|
+
//if (btnSubmit.buttonLoader != null) {
|
|
205
|
+
// btnSubmit.buttonLoader('reset');
|
|
206
|
+
//} else {
|
|
207
|
+
// btnSubmit.attr('disabled', false).button('reset');
|
|
208
|
+
//}
|
|
208
209
|
}
|
|
209
210
|
}
|
|
210
211
|
|
|
@@ -311,7 +312,7 @@ class EditValue {
|
|
|
311
312
|
|
|
312
313
|
let button = $('<button type="submit" class="btn btn-success ms-2" data-loading-text="<i class=\'fa fa-circle-notch fa-spin\'></i>" style="vertical-align: baseline;"><i class="fas fa-check"></i></button>');
|
|
313
314
|
button.click(function (e) {
|
|
314
|
-
parent.find('button')
|
|
315
|
+
FormHelper.buttonLoader(parent.find('button'), 'loading');
|
|
315
316
|
let newValue = parent.find('input').val();
|
|
316
317
|
onSubmitCallback(newValue, parent,
|
|
317
318
|
(isSuccess, valueFormatCallback) => {
|
package/import_from_csv.js
CHANGED
|
@@ -24,7 +24,7 @@ class ImportFromCsv {
|
|
|
24
24
|
|
|
25
25
|
formUpload.find('button[type="submit"]').click(function(event) {
|
|
26
26
|
event.preventDefault();
|
|
27
|
-
$(this)
|
|
27
|
+
FormHelper.buttonLoader($(this), 'loading');
|
|
28
28
|
formUpload.find('div.errors').addClass('hide');
|
|
29
29
|
|
|
30
30
|
let isFileParsed = false;
|
|
@@ -69,7 +69,7 @@ class ImportFromCsv {
|
|
|
69
69
|
if (!isFileParsed) {
|
|
70
70
|
formUpload.find('div.errors').html(errorMessageFileEmpty).removeClass('hide');
|
|
71
71
|
}
|
|
72
|
-
formUpload.find('button[type="submit"]')
|
|
72
|
+
FormHelper.buttonLoader(formUpload.find('button[type="submit"]'), 'reset');
|
|
73
73
|
}
|
|
74
74
|
});
|
|
75
75
|
event.preventDefault();
|
|
@@ -77,7 +77,7 @@ class ImportFromCsv {
|
|
|
77
77
|
|
|
78
78
|
formMatching.find('button[type="submit"]').click(function (event) {
|
|
79
79
|
event.preventDefault();
|
|
80
|
-
$(this)
|
|
80
|
+
FormHelper.buttonLoader($(this), 'loading');
|
|
81
81
|
formMatching.find('div.errors').addClass('hide').empty();
|
|
82
82
|
divResult.find('table tr').removeClass('danger');
|
|
83
83
|
|
|
@@ -86,7 +86,7 @@ class ImportFromCsv {
|
|
|
86
86
|
|
|
87
87
|
if ($.isEmptyObject(tabLink)) {
|
|
88
88
|
formMatching.find('div.errors').html(errorMessageImportSelectColumns).removeClass('hide');
|
|
89
|
-
$(this)
|
|
89
|
+
FormHelper.buttonLoader($(this), 'reset');
|
|
90
90
|
return false;
|
|
91
91
|
}
|
|
92
92
|
|
|
@@ -103,7 +103,7 @@ class ImportFromCsv {
|
|
|
103
103
|
else {
|
|
104
104
|
formMatching.find('div.errors').html(ImportFromCsv.getErrorsHtmlOfImportData(json, divResult)).removeClass('hide');
|
|
105
105
|
}
|
|
106
|
-
formMatching.find('button[type="submit"]')
|
|
106
|
+
FormHelper.buttonLoader(formMatching.find('button[type="submit"]'), 'reset');
|
|
107
107
|
}
|
|
108
108
|
);
|
|
109
109
|
});
|
package/media.js
CHANGED
|
@@ -15,14 +15,13 @@ class AudioMedia {
|
|
|
15
15
|
});
|
|
16
16
|
|
|
17
17
|
div.find('.play_asynchronously_link').off('click').click(function () {
|
|
18
|
-
if ($(this)
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
} else {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
}
|
|
25
|
-
|
|
18
|
+
//if (FormHelper.buttonLoader($(this), 'loading') != null) {
|
|
19
|
+
let button = FormHelper.buttonLoader($(this), 'loading');
|
|
20
|
+
AudioMedia.playAudioUrl($(this).data('url'), () => FormHelper.buttonLoader(button, 'reset'));
|
|
21
|
+
//} else {
|
|
22
|
+
// let button = $(this).attr('disabled', true).button('loading');
|
|
23
|
+
// AudioMedia.playAudioUrl($(this).data('url'), () => button.attr('disabled', false).button('reset'));
|
|
24
|
+
//}
|
|
26
25
|
return false;
|
|
27
26
|
});
|
|
28
27
|
|