a5bdfd14849bbe1da2a6b1b566a7fe1a19bd56c6
[redakcja.git] / src / catalogue / static / catalogue / woblink_admin.js
1 (function($) {
2     $(function() {
3
4         $(".admin-woblink").on("select2:open", function(e) {
5             console.log("TRIGGER", e);
6             let $input = $(".select2-container--open input");
7             let fname = $("#id_first_name_pl").val();
8             let lname = $("#id_last_name_pl").val();
9             console.log('A', fname, lname);
10             $input.val(
11                 fname + ' ' + lname
12             ).trigger('input');
13         });
14
15         $(".admin-woblink").on("select2:select", function(e) {
16             $('.fieldBox.field-woblink_link div').empty().append($('<a href="https://woblink.com/autor/-' + e.params.data.id + '" target="_blank">PodglÄ…d</a>'));
17
18         });
19
20
21     });
22 })(jQuery);