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