From 97b55af9cf8eab35fbaf18fa480f53642566a90e Mon Sep 17 00:00:00 2001 From: Osama Sayegh Date: Thu, 4 Feb 2021 06:41:53 +0300 Subject: [PATCH] DEV: Use @action decorator (#11955) Follow up to https://github.com/discourse/discourse/commit/db7b7eed9df1713a39cd6bde304cae077ce4c19c --- .../email-group-user-chooser-filter.js | 46 +++++++++---------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/app/assets/javascripts/select-kit/addon/components/email-group-user-chooser-filter.js b/app/assets/javascripts/select-kit/addon/components/email-group-user-chooser-filter.js index 7b301f75d0a..0d9002751a2 100644 --- a/app/assets/javascripts/select-kit/addon/components/email-group-user-chooser-filter.js +++ b/app/assets/javascripts/select-kit/addon/components/email-group-user-chooser-filter.js @@ -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; + } }, });