You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
devdocs/assets/javascripts/views/misc/notice.js

48 lines
1.0 KiB

// TODO: This file was created by bulk-decaffeinate.
// Sanity-check the conversion and remove this comment.
/*
* decaffeinate suggestions:
* DS002: Fix invalid constructor
* DS101: Remove unnecessary use of Array.from
* DS206: Consider reworking classes to avoid initClass
* Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md
*/
const Cls = (app.views.Notice = class Notice extends app.View {
static initClass() {
1 year ago
this.className = "_notice";
this.attributes = { role: "alert" };
}
11 years ago
1 year ago
constructor(type, ...rest) {
this.type = type;
[...this.args] = Array.from(rest);
super(...arguments);
}
11 years ago
init() {
this.activate();
}
11 years ago
activate() {
1 year ago
if (super.activate(...arguments)) {
this.show();
}
}
11 years ago
deactivate() {
1 year ago
if (super.deactivate(...arguments)) {
this.hide();
}
}
11 years ago
show() {
this.html(this.tmpl(`${this.type}Notice`, ...Array.from(this.args)));
this.prependTo(app.el);
}
11 years ago
hide() {
$.remove(this.el);
}
});
Cls.initClass();