From 5866a8bbbabbb58db42a69b36c3bf68795224867 Mon Sep 17 00:00:00 2001 From: Pierre Date: Sun, 7 Jan 2018 19:21:02 +0100 Subject: [PATCH] Added a function to easily refresh current page. --- assets/js/common/functionsSchema.js | 5 +++++ assets/js/common/page.js | 11 +++++++++++ 2 files changed, 16 insertions(+) diff --git a/assets/js/common/functionsSchema.js b/assets/js/common/functionsSchema.js index babeb9f9..c22886a7 100644 --- a/assets/js/common/functionsSchema.js +++ b/assets/js/common/functionsSchema.js @@ -159,6 +159,11 @@ var ComunicWeb = { */ openPage: function(pageURI, additionnalData){}, + /** + * Refresh the current page + */ + refresh_current_page: function(){}, + /** * Prepare a template load by specifying datas */ diff --git a/assets/js/common/page.js b/assets/js/common/page.js index 74b78618..066a16e8 100644 --- a/assets/js/common/page.js +++ b/assets/js/common/page.js @@ -252,6 +252,17 @@ ComunicWeb.common.page = { return true; }, + /** + * Refresh the current page + */ + refresh_current_page: function(){ + //Get current page URI + var currentPage = ComunicWeb.common.url.getCurrentWebsiteURL(); + + //Open a page + this.openPage(currentPage); + }, + /** * Prepare a template load by specifiying datas *