Commit 93daa859200110c004e0c40a3bf034e3e5688eae
1 parent
d4b462eb
Exists in
master
and in
2 other branches
Fixing badge bug on profile modal
Showing
2 changed files
with
21 additions
and
2 deletions
Show diff stats
amadeus/static/js/chat.js
| ... | ... | @@ -126,7 +126,7 @@ function getModalInfo(btn, space, space_type) { |
| 126 | 126 | $(this).text(actual); |
| 127 | 127 | } |
| 128 | 128 | } |
| 129 | - }); | |
| 129 | + }); | |
| 130 | 130 | |
| 131 | 131 | var counter = $(chat_list_item_id).find('.chat_notify_list').text(); |
| 132 | 132 | |
| ... | ... | @@ -194,6 +194,25 @@ function getModalInfo(btn, space, space_type) { |
| 194 | 194 | }); |
| 195 | 195 | } |
| 196 | 196 | |
| 197 | +function getProfile(btn, space, space_type) { | |
| 198 | + var url = btn.data('url'); | |
| 199 | + | |
| 200 | + $.ajax({ | |
| 201 | + method: 'get', | |
| 202 | + url: url, | |
| 203 | + data: {'space': space, 'space_type': space_type}, | |
| 204 | + success: function (response) { | |
| 205 | + var modal_shown = $("#chat-modal-info").is(":visible"); | |
| 206 | + | |
| 207 | + $("#chat-modal-info").html(response); | |
| 208 | + | |
| 209 | + $("#chat-modal-info").modal('show'); | |
| 210 | + | |
| 211 | + $.material.init(); | |
| 212 | + } | |
| 213 | + }); | |
| 214 | +} | |
| 215 | + | |
| 197 | 216 | function getForm(field) { |
| 198 | 217 | var url = field.data('url'); |
| 199 | 218 | ... | ... |
chat/templates/chat/_view_participant.html
| ... | ... | @@ -10,7 +10,7 @@ |
| 10 | 10 | <h4><a class="user_{{ participant.id }}_status status {{ status }}" data-toggle="tooltip" title="{{ status|status_text }}"></a> {{ participant }}</h4> |
| 11 | 11 | </div> |
| 12 | 12 | <div class="col-md-6 col-sm-6 col-xs-12 buttons pull-right text-center"> |
| 13 | - <a href="#" onclick="getModalInfo($(this), '{{ space }}', '{{ space_type }}'); return false;" data-url='{% url "chat:profile" participant.email %}' class="btn btn-raised btn-default">{% trans 'See Profile' %}</a> | |
| 13 | + <a href="#" onclick="getProfile($(this), '{{ space }}', '{{ space_type }}'); return false;" data-url='{% url "chat:profile" participant.email %}' class="btn btn-raised btn-default">{% trans 'See Profile' %}</a> | |
| 14 | 14 | <a href="#" onclick="getModalInfo($(this), '{{ space }}', '{{ space_type }}'); return false;" data-url='{% url "chat:talk" participant.email %}' class="btn btn-raised btn-success">{% trans 'Send Message' %}</a> |
| 15 | 15 | </div> |
| 16 | 16 | </div> | ... | ... |