Skip to content

Commit 845281f

Browse files
committed
fix ticket-0866
1 parent 935f640 commit 845281f

File tree

3 files changed

+5
-13
lines changed

3 files changed

+5
-13
lines changed

src/Public/static/js/default.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,10 @@ function addUserContact(obj, userid) {
6060
);
6161
}
6262
var clmodeswitchdiv = "";
63-
function showContactModeSwitcher(div, contactid) {
63+
function showContactModeSwitcher(element, div, contactid) {
6464
clmodeswitchdiv = div;
65-
updatePopup(
65+
updatePopupAtElement(
66+
element,
6667
"/pm.php?SHOW_CONTACT_MODESWITCH=1&contactid=" + contactid,
6768
70
6869
);

src/html/macros.twig

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -123,16 +123,7 @@
123123
{% endmacro %}
124124

125125
{% macro contactModeSwitcher(contact, div) %}
126-
{% if contact %}
127-
{% set mode = contact.getMode.value %}
128-
{% set description = contact.getMode.getTitle %}
129-
{% if div %}
130-
<span class="cltype{{ mode }}" id="contact{{ contact.getId }}"
131-
onclick="showContactModeSwitcher('{{ div }}',{{ contact.getId }});">{{ description }}</span>
132-
{% else %}
133-
<span class="cltype{{ mode }}" style="cursor: auto;">{{ description }}</span>
134-
{% endif %}
135-
{% endif %}
126+
{% include 'html/user/contactMode.twig' %}
136127
{% endmacro %}
137128

138129
{% macro translationSwitcher(hasTranslation, id, title) %}

src/html/user/contactMode.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
{% if div %}
77
<span class="cltype{{ value }}" id="contact{{ contact.getId }}"
8-
onclick="showContactModeSwitcher('{{ div }}', {{ contact.getId }});">{{ title }}</span>
8+
onclick="showContactModeSwitcher(this, '{{ div }}', {{ contact.getId }});">{{ title }}</span>
99
{% else %}
1010
<span class="cltype{{ value }}" style="cursor: auto;">{{ title }}</span>
1111
{% endif %}

0 commit comments

Comments
 (0)