UX: Add class for targeting

This commit is contained in:
Robin Ward 2017-11-14 14:42:25 -05:00
parent 23baaa5dcc
commit 77594ab107
2 changed files with 5 additions and 5 deletions

View File

@ -42,7 +42,7 @@ export default TextField.extend({
allowAny: this.get('allowAny'),
updateData: (opts && opts.updateData) ? opts.updateData : false,
dataSource: function(term) {
dataSource(term) {
const termRegex = Discourse.User.currentProp('can_send_private_email_messages') ?
/[^a-zA-Z0-9_\-\.@\+]/ : /[^a-zA-Z0-9_\-\.]/;
@ -60,7 +60,7 @@ export default TextField.extend({
return results;
},
transformComplete: function(v) {
transformComplete(v) {
if (v.username || v.name) {
if (!v.username) { groups.push(v.name); }
return v.username || v.name;
@ -72,7 +72,7 @@ export default TextField.extend({
}
},
onChangeItems: function(items) {
onChangeItems(items) {
var hasGroups = false;
items = items.map(function(i) {
if (groups.indexOf(i) > -1) { hasGroups = true; }
@ -85,7 +85,7 @@ export default TextField.extend({
if (self.get('onChangeCallback')) self.sendAction('onChangeCallback');
},
reverseTransform: function(i) {
reverseTransform(i) {
return { username: i };
}

View File

@ -1,4 +1,4 @@
{{#d-modal-body}}
{{#d-modal-body class='change-ownership'}}
{{{i18n 'topic.change_owner.instructions' count=selectedPostsCount old_user=selectedPostsUsername}}}
<p>
{{{i18n 'topic.change_owner.instructions_warn'}}}