projects
/
kivitendo-erp.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
0ad9546
)
js-Validator: Leerzeichen trimmen können
author
Bernd Bleßmann
<bernd@kivitendo-premium.de>
Thu, 25 Nov 2021 15:10:12 +0000
(16:10 +0100)
committer
Bernd Bleßmann
<bernd@kivitendo-premium.de>
Thu, 25 Nov 2021 15:10:12 +0000
(16:10 +0100)
js/kivi.Validator.js
patch
|
blob
|
history
diff --git
a/js/kivi.Validator.js
b/js/kivi.Validator.js
index
b564ffb
..
4d03451
100644
(file)
--- a/
js/kivi.Validator.js
+++ b/
js/kivi.Validator.js
@@
-142,6
+142,26
@@
namespace("kivi.Validator", function(ns) {
ns.annotate($e_annotate);
return true;
}
ns.annotate($e_annotate);
return true;
}
+ },
+ trimmed_whitespaces: function($e, $e_annotate) {
+ $e_annotate = $e_annotate || $e;
+
+ var string = $e.val();
+
+ if ($e.hasClass('tooltipstered'))
+ $e.tooltipster('destroy');
+
+ if (string.match(/^\s|\s$/)) {
+ $e.val(string.trim());
+
+ $e.tooltipster({
+ content: kivi.t8("Leading and trailing whitespaces have been removed."),
+ contentAsHTML: true,
+ theme: 'tooltipster-light',
+ });
+ $e.tooltipster('show');
+ }
+ return true;
}
};
}
};