Merge branch 'fronkdev' into 'master'

minor layout changes for vodia switcher

See merge request fronk/thetool!1484
This commit is contained in:
Frank Schubert
2025-06-24 10:52:32 +00:00
2 changed files with 9 additions and 9 deletions

View File

@@ -15,6 +15,7 @@
<!-- End mobile menu toggle-->
</li>
<?php if(defined("ENABLE_VODIA_IDENTITY_SWITCHER") && ENABLE_VODIA_IDENTITY_SWITCHER && $me->is("employee")): ?>
<li id="vodia-identity-container" class="dropdown notification-list hidden" >
<a href="#" id="vodia-identity-switcher" class="nav-link nav-user dropdown-toggle" data-toggle="dropdown" aria-expanded="false">
<i class="phone-icon fas fa-phone text-success"></i>
@@ -51,6 +52,7 @@
</table>
</li>
</template>
<?php endif; ?>
<li id="bookstackLink" class="dropdown notification-list" style="display: none">
<a class="nav-link dropdown-toggle" href="" target="_blank">

View File

@@ -28,21 +28,20 @@ async function getVodiaIdentity() {
return true;
}
var default_ident = vodia_identity.default;
var default_ident_number = vodia_identity.default_number;
var default_ident_number = vodia_identity.default_number.replaceAll(' ', "");
var current_ident = vodia_identity.current;
var current_ident_number = current_ident.replace(" ", "");
var current_ident_number = current_ident.replaceAll(' ', "");
var identities = vodia_identity.identities;
$("#vodia-identity-container").show();
if(default_ident_number == current_ident_number) {
$("#vodia-identity-current-text").text("Standard");
$("#vodia-identity-current-text").text("Xinon Eigene Durchwahl");
$("#vodia-identity-current-number").text("(" + default_ident + ")");
$("#vodia-identity-switcher").attr("title", "Standard (" + default_ident + ")");
$("#vodia-identity-switcher").attr("title", "Xinon Eigene Durchwahl (" + default_ident + ")");
} else {
ident_found = false;
for(const [ident_name, ident] of Object.entries(identities)) {
@@ -69,6 +68,7 @@ async function getVodiaIdentity() {
"blue"
);
console.log(default_ident_number, current_ident_number);
if(default_ident_number == current_ident_number) {
$(item).addClass("bg-info text-white");
$(item).find(".text-block").addClass("text-white");
@@ -111,21 +111,19 @@ function addVodiaIdentityListItem(number, number_display, name, color) {
//item = $($.parseXML(tpl)).contents();
const puffFragment = document.querySelector("#vodia-identity-list-item-template").content.cloneNode(true);
const item = puffFragment.querySelector('li');
const tpl = document.querySelector("#vodia-identity-list-item-template").content.cloneNode(true);
const item = tpl.querySelector('li');
//console.log(item);
$(item).data("number", number);
console.log($(item).find("td.color-block"));
$(item).find("td.color-block").addClass("color-block-" + color);
$(item).find("span.name").text(name);
$(item).find("span.number").text("(" + number_display + ")");
$("#vodia-identities-list").append(item);
console.log($(item)[0].outerHTML);
return item;
}