mirror of
https://github.com/alextselegidis/easyappointments.git
synced 2024-11-25 17:33:19 +03:00
Enhancements in the backend_settings_user.js comments.
This commit is contained in:
parent
32c39a02a1
commit
628e208804
1 changed files with 9 additions and 7 deletions
|
@ -14,7 +14,8 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* "User Settings" Tab Helper
|
* "User Settings" Tab Helper Class
|
||||||
|
*
|
||||||
* @class UserSettings
|
* @class UserSettings
|
||||||
*/
|
*/
|
||||||
var UserSettings = function() {};
|
var UserSettings = function() {};
|
||||||
|
@ -22,7 +23,7 @@
|
||||||
/**
|
/**
|
||||||
* Get the settings data for the user settings.
|
* Get the settings data for the user settings.
|
||||||
*
|
*
|
||||||
* @returns {object} Returns the user settings array.
|
* @returns {Object} Returns the user settings array.
|
||||||
*/
|
*/
|
||||||
UserSettings.prototype.get = function() {
|
UserSettings.prototype.get = function() {
|
||||||
var user = {
|
var user = {
|
||||||
|
@ -53,7 +54,7 @@
|
||||||
/**
|
/**
|
||||||
* Store the user settings into the database.
|
* Store the user settings into the database.
|
||||||
*
|
*
|
||||||
* @param {array} settings Contains the user settings.
|
* @param {Array} settings Contains the user settings.
|
||||||
*/
|
*/
|
||||||
UserSettings.prototype.save = function(settings) {
|
UserSettings.prototype.save = function(settings) {
|
||||||
if (!this.validate(settings)) {
|
if (!this.validate(settings)) {
|
||||||
|
@ -82,10 +83,11 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Validate the settings data. If the validation fails then display a
|
* Validate the settings data.
|
||||||
* message to the user.
|
|
||||||
*
|
*
|
||||||
* @returns {bool} Returns the validation result.
|
* If the validation fails then display a message to the user.
|
||||||
|
*
|
||||||
|
* @return {Boolean} Returns the validation result.
|
||||||
*/
|
*/
|
||||||
UserSettings.prototype.validate = function() {
|
UserSettings.prototype.validate = function() {
|
||||||
$('#user .required').css('border', '');
|
$('#user .required').css('border', '');
|
||||||
|
@ -95,7 +97,7 @@
|
||||||
// Validate required fields.
|
// Validate required fields.
|
||||||
var missingRequired = false;
|
var missingRequired = false;
|
||||||
$('#user .required').each(function() {
|
$('#user .required').each(function() {
|
||||||
if ($(this).val() == '' || $(this).val() == undefined) {
|
if ($(this).val() === '' || $(this).val() === undefined) {
|
||||||
$(this).css('border', '2px solid red');
|
$(this).css('border', '2px solid red');
|
||||||
missingRequired = true;
|
missingRequired = true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue