summaryrefslogtreecommitdiffstats
path: root/settings/js
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2015-05-05 11:58:19 +0200
committerMorris Jobke <hey@morrisjobke.de>2015-05-05 11:58:19 +0200
commit5fd849f5457cd7f9d47c6fa5019ff0f79fcbc6af (patch)
tree15db87153ae2535ebac53d5cb70b5067e05e8dd5 /settings/js
parent179472aeef78b8cf4eebbc0bb73c56581cb13825 (diff)
downloadnextcloud-server-5fd849f5457cd7f9d47c6fa5019ff0f79fcbc6af.tar.gz
nextcloud-server-5fd849f5457cd7f9d47c6fa5019ff0f79fcbc6af.zip
Allow user to set an empty email address
* fixes #16057
Diffstat (limited to 'settings/js')
-rw-r--r--settings/js/personal.js9
1 files changed, 5 insertions, 4 deletions
diff --git a/settings/js/personal.js b/settings/js/personal.js
index c9ecfdb4869..3745b1372ea 100644
--- a/settings/js/personal.js
+++ b/settings/js/personal.js
@@ -12,8 +12,9 @@
* user or 1 second after the last data entry
*
* @param callback
+ * @param allowEmptyValue if this is set to true the callback is also called when the value is empty
*/
-jQuery.fn.keyUpDelayedOrEnter = function (callback) {
+jQuery.fn.keyUpDelayedOrEnter = function (callback, allowEmptyValue) {
var cb = callback;
var that = this;
this.keyup(_.debounce(function (event) {
@@ -21,13 +22,13 @@ jQuery.fn.keyUpDelayedOrEnter = function (callback) {
if (event.keyCode === 13) {
return;
}
- if (that.val() !== '') {
+ if (allowEmptyValue || that.val() !== '') {
cb();
}
}, 1000));
this.keypress(function (event) {
- if (event.keyCode === 13 && that.val() !== '') {
+ if (event.keyCode === 13 && (allowEmptyValue || that.val() !== '')) {
event.preventDefault();
cb();
}
@@ -213,7 +214,7 @@ $(document).ready(function () {
});
$('#displayName').keyUpDelayedOrEnter(changeDisplayName);
- $('#email').keyUpDelayedOrEnter(changeEmailAddress);
+ $('#email').keyUpDelayedOrEnter(changeEmailAddress, true);
$("#languageinput").change(function () {
// Serialize the data