From 85291fafbaf2f7c5ad63549d05fb49a4f324b8f3 Mon Sep 17 00:00:00 2001 From: Pierre Date: Sat, 3 Feb 2018 13:38:38 +0100 Subject: [PATCH] Handles errors when retrieving latests posts. --- assets/css/pages/latestPosts/main.css | 12 +++++++++++- assets/js/pages/latestPosts/main.js | 5 +++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/assets/css/pages/latestPosts/main.css b/assets/css/pages/latestPosts/main.css index 6e1dbb9e..a9f86b77 100644 --- a/assets/css/pages/latestPosts/main.css +++ b/assets/css/pages/latestPosts/main.css @@ -2,4 +2,14 @@ * Latests post stylesheet * * @author Pierre HUBERT - */ \ No newline at end of file + */ + +/** + * Error message + */ +.latestPostsError { + width: 100%; + max-width: 500px; + margin: auto; + margin-top: 30px; +} \ No newline at end of file diff --git a/assets/js/pages/latestPosts/main.js b/assets/js/pages/latestPosts/main.js index a389a3cb..b1b07f1b 100644 --- a/assets/js/pages/latestPosts/main.js +++ b/assets/js/pages/latestPosts/main.js @@ -20,6 +20,11 @@ ComunicWeb.pages.latestPosts.main = { //Check for errors - display a modal if(response.error){ + //Display modal error + var error = ComunicWeb.common.messages.createCalloutElem("Error", "Could not get the list of the latest posts ! Please try to refresh the page...", "danger"); + error.className += " latestPostsError"; + target.appendChild(error); + return; }