Commit 94d242c34e182e8fcb0584a768318908c9ce412b
1 parent
d91cf75f
Exists in
master
and in
3 other branches
Adding talk breadcrumb
Showing
2 changed files
with
30 additions
and
1 deletions
Show diff stats
amadeus/static/js/chat.js
1 | var new_msgs = {}; | 1 | var new_msgs = {}; |
2 | 2 | ||
3 | +$('#chat-modal-info').on('show.bs.modal', function (e) { | ||
4 | + var header = $(this).find('.talk_header'); | ||
5 | + if (header.length > 0) { | ||
6 | + var li = $(".breadcrumb").find('li:last-child'); | ||
7 | + var li_text = $(li).html(); | ||
8 | + var new_li = $(li).clone(); | ||
9 | + | ||
10 | + new_li.html(header.find('h4').data('breadcrumb')); | ||
11 | + | ||
12 | + $(li).html("<a href='#'>" + li_text + "</a>"); | ||
13 | + $(li).append("<span class='divider'>/</span>"); | ||
14 | + | ||
15 | + new_li.appendTo('.breadcrumb'); | ||
16 | + } | ||
17 | +}); | ||
18 | + | ||
19 | +$('#chat-modal-info').on('hide.bs.modal', function (e) { | ||
20 | + var header = $(this).find('.talk_header'); | ||
21 | + if (header.length > 0) { | ||
22 | + $(".breadcrumb").find('li:last-child').remove(); | ||
23 | + | ||
24 | + var li = $(".breadcrumb").find('li:last-child'); | ||
25 | + var text = $(li).find('a').text(); | ||
26 | + | ||
27 | + $(li).html(text); | ||
28 | + } | ||
29 | +}); | ||
30 | + | ||
31 | + | ||
3 | function getModalInfo(btn, space, space_type) { | 32 | function getModalInfo(btn, space, space_type) { |
4 | var url = btn.data('url'); | 33 | var url = btn.data('url'); |
5 | 34 |
chat/templates/chat/talk.html
@@ -10,7 +10,7 @@ | @@ -10,7 +10,7 @@ | ||
10 | <span class="pull-left"> | 10 | <span class="pull-left"> |
11 | <img src="{{ participant.image_url }}" /> | 11 | <img src="{{ participant.image_url }}" /> |
12 | </span> | 12 | </span> |
13 | - <h4 class=" pull-left"> | 13 | + <h4 class="pull-left" data-breadcrumb="{% trans 'Talk with ' %}{{ participant }}"> |
14 | <a class="status {{ status }}" title="{{ status|status_text }}"></a> | 14 | <a class="status {{ status }}" title="{{ status|status_text }}"></a> |
15 | <b>{{ participant }}</b> | 15 | <b>{{ participant }}</b> |
16 | </h4> | 16 | </h4> |