ui_report: Remove now redundant `type` argument from `.message()`.

It's no longer used, as can be seen in
2d52463b61, in past we use `type` for
specifiying whether status is 'subscriptions-status' or else, which isn't
used now, hence `type` is removed here.
This commit is contained in:
Shubham Dhama 2019-01-17 18:04:56 +05:30 committed by Tim Abbott
parent 09ab874642
commit 93ddf2ca37
1 changed files with 5 additions and 10 deletions

View File

@ -6,18 +6,13 @@ var exports = {};
response- response that we want to display response- response that we want to display
status_box- element being used to display the response status_box- element being used to display the response
cls- class that we want to add/remove to/from the status_box 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) { if (cls === undefined) {
cls = 'alert'; cls = 'alert';
} }
if (type === undefined) {
type = ' ';
}
// Note we use html() below, since we can rely on our callers escaping HTML // Note we use html() below, since we can rely on our callers escaping HTML
// via i18n.t when interpolating data. // via i18n.t when interpolating data.
status_box.removeClass(common.status_classes).addClass(cls) status_box.removeClass(common.status_classes).addClass(cls)
@ -39,7 +34,7 @@ function escape(html) {
.replace(/'/g, '''); .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") { if (xhr && xhr.status.toString().charAt(0) === "4") {
// Only display the error response for 4XX, where we've crafted // Only display the error response for 4XX, where we've crafted
// a nice response. // 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.success = function (response, status_box, remove_after) {
exports.message(response, status_box, 'alert-success', type, remove_after); exports.message(response, status_box, 'alert-success', remove_after);
}; };
exports.generic_embed_error = function (error) { exports.generic_embed_error = function (error) {