From 27057190cebf7d2746a3a7e456dc4fd35ccb4423 Mon Sep 17 00:00:00 2001 From: Faye Li Date: Mon, 13 Feb 2017 11:01:37 -0800 Subject: [PATCH] display users even if they dont have a domain name --- scripts/system/html/users.html | 39 ++++++++++++++++++++-------------- 1 file changed, 23 insertions(+), 16 deletions(-) diff --git a/scripts/system/html/users.html b/scripts/system/html/users.html index 39f67833ca..e00cf7f2e4 100644 --- a/scripts/system/html/users.html +++ b/scripts/system/html/users.html @@ -338,25 +338,28 @@ function displayUsers(data, element) { element.empty(); for (var i = 0; i < data.users.length; i++) { - // Don't display users who aren't in a domain - if (typeof data.users[i].location.root.name === "undefined") { + // Display users who aren't in a domain differently + if (typeof data.users[i].location.root.name === "undefined" || data.users[i].location.root.name === null) { console.log(data.users[i].username + "is online but not in a domain"); $("#dev-div").append("

" + data.users[i].username + "is online but not in a domain

"); + $("
  • ", { + "data-toggle": "modal", + "data-target": "#myModal", + "data-username": data.users[i].username, + "data-placename": "", + text: data.users[i].username + }).appendTo(element); } else { $("#dev-div").append("
  • " + data.users[i].username + " @ " + data.users[i].location.root.name + "
  • "); - if (data.users[i].username === myUsername) { - $("#user-info-div h4").text(data.users[i].username + " @ " + data.users[i].location.root.name); - } else { - console.log(data.users[i].username + " @ " + data.users[i].location.root.name); - // Create a list item and put user info in data-* attributes, also make it trigger the jump to confirmation modal - $("
  • ", { - "data-toggle": "modal", - "data-target": "#myModal", - "data-username": data.users[i].username, - "data-placename": data.users[i].location.root.name, - text: data.users[i].username + " @ " + data.users[i].location.root.name - }).appendTo(element); - } + console.log(data.users[i].username + " @ " + data.users[i].location.root.name); + // Create a list item and put user info in data-* attributes, also make it trigger the jump to confirmation modal + $("
  • ", { + "data-toggle": "modal", + "data-target": "#myModal", + "data-username": data.users[i].username, + "data-placename": data.users[i].location.root.name, + text: data.users[i].username + " @ " + data.users[i].location.root.name + }).appendTo(element); } } } @@ -454,7 +457,11 @@ var placename = li.data("placename"); // Write info to the modal var modal = $(this); - modal.find(".modal-title").text("Jump to " + username + " @ " + placename); + if (placename === "") { + modal.find(".modal-title").text("Jump to " + username); + } else { + modal.find(".modal-title").text("Jump to " + username + " @ " + placename); + } $("#jump-to-confirm-button").data("username", username); })