DEV: Don't use attrs (#24323)

This commit is contained in:
Jarek Radosz
2023-11-27 12:16:31 +01:00
committed by GitHub
parent e05dbba845
commit b1e43425bf
14 changed files with 30 additions and 32 deletions

View File

@@ -116,11 +116,11 @@ export default class AceEditor extends Component {
this._skipContentChangeEvent = true;
this.set("content", editor.getSession().getValue());
});
if (this.attrs.save) {
if (this.save) {
editor.commands.addCommand({
name: "save",
exec: () => {
this.attrs.save();
this.save();
},
bindKey: { mac: "cmd-s", win: "ctrl-s" },
});

View File

@@ -220,11 +220,11 @@ export default class AdminReport extends Component {
@action
refreshReport(options = {}) {
if (!this.attrs.onRefresh) {
if (!this.onRefresh) {
return;
}
this.attrs.onRefresh({
this.onRefresh({
type: this.get("model.type"),
mode: this.currentMode,
chartGrouping: options.chartGrouping,

View File

@@ -45,8 +45,8 @@ export default class ColorInput extends Component {
@action
onHexInput(event) {
if (this.attrs.onChangeColor) {
this.attrs.onChangeColor(this.normalize(event.target.value || ""));
if (this.onChangeColor) {
this.onChangeColor(this.normalize(event.target.value || ""));
}
}
@@ -59,8 +59,8 @@ export default class ColorInput extends Component {
hexValueChanged() {
const hex = this.hexValue;
if (this.attrs.onChangeColor) {
this.attrs.onChangeColor(this.normalize(hex));
if (this.onChangeColor) {
this.onChangeColor(this.normalize(hex));
}
if (this._valid()) {