From 93ddf2ca3746e9ac7b1f344da5a8402346e32ce5 Mon Sep 17 00:00:00 2001 From: Shubham Dhama Date: Thu, 17 Jan 2019 18:04:56 +0530 Subject: [PATCH] ui_report: Remove now redundant `type` argument from `.message()`. It's no longer used, as can be seen in 2d52463b61614ad17f029a34433303d61989521d, in past we use `type` for specifiying whether status is 'subscriptions-status' or else, which isn't used now, hence `type` is removed here. --- static/js/ui_report.js | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/static/js/ui_report.js b/static/js/ui_report.js index 786ff94f18..3dbe50218b 100644 --- a/static/js/ui_report.js +++ b/static/js/ui_report.js @@ -6,18 +6,13 @@ var exports = {}; response- response that we want to display status_box- element being used to display the response cls- class that we want to add/remove to/from the status_box - type- used to define more complex logic for special cases */ -exports.message = function (response, status_box, cls, type, remove_after) { +exports.message = function (response, status_box, cls, remove_after) { if (cls === undefined) { cls = 'alert'; } - if (type === undefined) { - type = ' '; - } - // Note we use html() below, since we can rely on our callers escaping HTML // via i18n.t when interpolating data. status_box.removeClass(common.status_classes).addClass(cls) @@ -39,7 +34,7 @@ function escape(html) { .replace(/'/g, '''); } -exports.error = function (response, xhr, status_box, type) { +exports.error = function (response, xhr, status_box) { if (xhr && xhr.status.toString().charAt(0) === "4") { // Only display the error response for 4XX, where we've crafted // a nice response. @@ -51,11 +46,11 @@ exports.error = function (response, xhr, status_box, type) { } } - exports.message(response, status_box, 'alert-error', type); + exports.message(response, status_box, 'alert-error'); }; -exports.success = function (response, status_box, type, remove_after) { - exports.message(response, status_box, 'alert-success', type, remove_after); +exports.success = function (response, status_box, remove_after) { + exports.message(response, status_box, 'alert-success', remove_after); }; exports.generic_embed_error = function (error) {