From 7f8ee4f94dce38d105786acc7bfbe51215bebf48 Mon Sep 17 00:00:00 2001 From: Eric Lippmann Date: Tue, 14 Jan 2020 14:53:25 +0100 Subject: [PATCH] JS: Deprecate Icinga.Loader.addUrlFlag() in favor of Icinga.Utils.addUrlFlag() --- public/js/icinga/loader.js | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/public/js/icinga/loader.js b/public/js/icinga/loader.js index e1dea3e1d..36fd72ec3 100644 --- a/public/js/icinga/loader.js +++ b/public/js/icinga/loader.js @@ -415,13 +415,19 @@ return true; }, + /** + * Add the specified flag to the given URL + * + * @param {string} url + * @param {string} flag + * + * @returns {string} + * + * @deprecated since version 2.8.0. Use {@link Icinga.Utils.addUrlFlag()} instead + */ addUrlFlag: function(url, flag) { - if (url.match(/\?/)) { - return url + '&' + flag; - } else { - return url + '?' + flag; - } + return this.icinga.utils.addUrlFlag(url, flag); }, /**