mirror of
				https://github.com/TitanEmbeds/Titan.git
				synced 2025-10-31 05:49:09 +01:00 
			
		
		
		
	Hide roles label in usercard if there is no roles to be displayed
This commit is contained in:
		| @@ -803,11 +803,13 @@ | |||||||
|                 return parseFloat(b.position) - parseFloat(a.position); |                 return parseFloat(b.position) - parseFloat(a.position); | ||||||
|             }); |             }); | ||||||
|             $("#usercard .role .roles").empty(); |             $("#usercard .role .roles").empty(); | ||||||
|  |             var rolecount = 0; | ||||||
|             for (var j = 0; j < data.roles.length; j++) { |             for (var j = 0; j < data.roles.length; j++) { | ||||||
|                 var role = data.roles[j]; |                 var role = data.roles[j]; | ||||||
|                 if (role.id == guild_id) { |                 if (role.id == guild_id) { | ||||||
|                     continue; |                     continue; | ||||||
|                 } |                 } | ||||||
|  |                 rolecount++; | ||||||
|                 var color = null; |                 var color = null; | ||||||
|                 if (role.color) { |                 if (role.color) { | ||||||
|                     color = "#" + role.color.toString(16); |                     color = "#" + role.color.toString(16); | ||||||
| @@ -815,6 +817,11 @@ | |||||||
|                 var rol = Mustache.render(template, {name: role.name, color: color}); |                 var rol = Mustache.render(template, {name: role.name, color: color}); | ||||||
|                 $("#usercard .role .roles").append(rol); |                 $("#usercard .role .roles").append(rol); | ||||||
|             } |             } | ||||||
|  |             if (rolecount) { | ||||||
|  |                 $("#usercard .role").show(); | ||||||
|  |             } else { | ||||||
|  |                 $("#usercard .role").hide(); | ||||||
|  |             } | ||||||
|              |              | ||||||
|             $("#usercard-mention-btn").off("click"); |             $("#usercard-mention-btn").off("click"); | ||||||
|             $("#usercard-mention-btn").click(function () { |             $("#usercard-mention-btn").click(function () { | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user