mirror of https://github.com/zulip/zulip.git
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:
parent
09ab874642
commit
93ddf2ca37
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue