summaryrefslogtreecommitdiff
path: root/assets/js/components/autocomplete-email.js
blob: 9d337e037578467ceb162067df12de62c78bc5e5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
KB.onClick('.js-autocomplete-email', function (e) {
    var email = KB.dom(e.target).data('email');
    var emailField = KB.find('.js-mail-form input[type="email"]');

    if (email && emailField) {
        emailField.build().value = email;
    }

    _KB.controllers.Dropdown.close();
});

KB.onClick('.js-autocomplete-subject', function (e) {
    var subject = KB.dom(e.target).data('subject');
    var subjectField = KB.find('.js-mail-form input[name="subject"]');

    if (subject && subjectField) {
        subjectField.build().value = subject;
    }

    _KB.controllers.Dropdown.close();
});