minor layout changes for vodia switcher
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user