From 8dedc3368a5c501f19f0ce18cbcd1c54652d2137 Mon Sep 17 00:00:00 2001 From: Alex Tselegidis Date: Sat, 14 May 2016 12:38:25 +0200 Subject: [PATCH] Enhancements in the backend.js comments. --- src/assets/js/backend.js | 35 ++++++++++++++++------------------- 1 file changed, 16 insertions(+), 19 deletions(-) diff --git a/src/assets/js/backend.js b/src/assets/js/backend.js index 88450764..5170f6c7 100644 --- a/src/assets/js/backend.js +++ b/src/assets/js/backend.js @@ -12,8 +12,9 @@ window.Backend = window.Backend || {}; /** - * This module contains functions that are used in the backend section of - * the application. + * Backend + * + * This module contains functions that are used in the backend section of the application. * * @module Backend */ @@ -25,13 +26,13 @@ window.Backend = window.Backend || {}; * Main javascript code for the backend of Easy!Appointments. */ $(document).ready(function() { - if (window.console === undefined) { - window.console = function() {} // IE compatibility - } + window.console = window.console || function() {}; // IE compatibility - $(window).resize(function() { - Backend.placeFooterToBottom(); - }).trigger('resize'); + $(window) + .resize(function() { + Backend.placeFooterToBottom(); + }) + .trigger('resize'); $(document).ajaxStart(function() { $('#loading').show(); @@ -96,21 +97,17 @@ window.Backend = window.Backend || {}; /** * Display backend notifications to user. * - * Using this method you can display notifications to the use with custom - * messages. If the 'actions' array is provided then an action link will - * be displayed too. + * Using this method you can display notifications to the use with custom messages. If the + * 'actions' array is provided then an action link will be displayed too. * - * @param {string} message Notification message - * @param {array} actions An array with custom actions that will be available - * to the user. Every array item is an object that contains the 'label' and - * 'function' key values. + * @param {String} message Notification message + * @param {Array} actions An array with custom actions that will be available to the user. Every + * array item is an object that contains the 'label' and 'function' key values. */ exports.displayNotification = function(message, actions) { - if (message == undefined) { - message = 'NO MESSAGE PROVIDED FOR THIS NOTIFICATION'; - } + message = message || 'NO MESSAGE PROVIDED FOR THIS NOTIFICATION'; - if (actions == undefined) { + if (actions === undefined) { actions = []; setTimeout(function() { $('#notification').slideUp('slow');