DEV: Use @action decorator (#11955)

Follow up to db7b7eed9d
This commit is contained in:
Osama Sayegh 2021-02-04 06:41:53 +03:00 committed by GitHub
parent d518b302a0
commit 97b55af9cf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 23 additions and 23 deletions

View File

@ -1,35 +1,35 @@
import MultiSelectFilterComponent from "select-kit/components/multi-select/multi-select-filter";
import { action } from "@ember/object";
export default MultiSelectFilterComponent.extend({
classNames: ["email-group-user-chooser-filter"],
actions: {
onPaste(event) {
const data = event.originalEvent.clipboardData;
@action
onPaste(event) {
const data = event.originalEvent.clipboardData;
if (!data) {
return;
}
if (!data) {
return;
}
const recipients = [];
data
.getData("text")
.split(/[, \n]+/)
.forEach((recipient) => {
recipient = recipient.replace(/^@+/, "").trim();
if (recipient.length > 0) {
recipients.push(recipient);
}
});
const recipients = [];
data
.getData("text")
.split(/[, \n]+/)
.forEach((recipient) => {
recipient = recipient.replace(/^@+/, "").trim();
if (recipient.length > 0) {
recipients.push(recipient);
}
});
if (recipients.length > 0) {
event.stopPropagation();
event.preventDefault();
if (recipients.length > 0) {
event.stopPropagation();
event.preventDefault();
this.selectKit.append(recipients);
this.selectKit.append(recipients);
return false;
}
},
return false;
}
},
});