parent
179472aeef
commit
5fd849f545
|
@ -504,7 +504,12 @@ class UsersController extends Controller {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// delete user value if email address is empty
|
||||||
|
if($mailAddress === '') {
|
||||||
|
$this->config->deleteUserValue($id, 'settings', 'email');
|
||||||
|
} else {
|
||||||
$this->config->setUserValue($id, 'settings', 'email', $mailAddress);
|
$this->config->setUserValue($id, 'settings', 'email', $mailAddress);
|
||||||
|
}
|
||||||
|
|
||||||
return new DataResponse(
|
return new DataResponse(
|
||||||
array(
|
array(
|
||||||
|
|
|
@ -12,8 +12,9 @@
|
||||||
* user or 1 second after the last data entry
|
* user or 1 second after the last data entry
|
||||||
*
|
*
|
||||||
* @param callback
|
* @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 cb = callback;
|
||||||
var that = this;
|
var that = this;
|
||||||
this.keyup(_.debounce(function (event) {
|
this.keyup(_.debounce(function (event) {
|
||||||
|
@ -21,13 +22,13 @@ jQuery.fn.keyUpDelayedOrEnter = function (callback) {
|
||||||
if (event.keyCode === 13) {
|
if (event.keyCode === 13) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (that.val() !== '') {
|
if (allowEmptyValue || that.val() !== '') {
|
||||||
cb();
|
cb();
|
||||||
}
|
}
|
||||||
}, 1000));
|
}, 1000));
|
||||||
|
|
||||||
this.keypress(function (event) {
|
this.keypress(function (event) {
|
||||||
if (event.keyCode === 13 && that.val() !== '') {
|
if (event.keyCode === 13 && (allowEmptyValue || that.val() !== '')) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
cb();
|
cb();
|
||||||
}
|
}
|
||||||
|
@ -213,7 +214,7 @@ $(document).ready(function () {
|
||||||
});
|
});
|
||||||
|
|
||||||
$('#displayName').keyUpDelayedOrEnter(changeDisplayName);
|
$('#displayName').keyUpDelayedOrEnter(changeDisplayName);
|
||||||
$('#email').keyUpDelayedOrEnter(changeEmailAddress);
|
$('#email').keyUpDelayedOrEnter(changeEmailAddress, true);
|
||||||
|
|
||||||
$("#languageinput").change(function () {
|
$("#languageinput").change(function () {
|
||||||
// Serialize the data
|
// Serialize the data
|
||||||
|
|
Loading…
Reference in New Issue