Software /
code /
prosody-modules
Comparison
mod_invites_page/html/invite.html @ 4134:82713dfee238
mod_invites_page: Fix platform detection and don't show empty list of clients for unknown platforms
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Tue, 15 Sep 2020 16:27:48 +0100 |
parent | 4131:330b1948bdc0 |
child | 4172:740ca44eba06 |
comparison
equal
deleted
inserted
replaced
4133:0ba6108afcbf | 4134:82713dfee238 |
---|---|
145 break; | 145 break; |
146 default: | 146 default: |
147 if(platform.os.family.startsWith("Windows")) { | 147 if(platform.os.family.startsWith("Windows")) { |
148 platform_friendly = "Windows"; | 148 platform_friendly = "Windows"; |
149 platform_classname = "windows"; | 149 platform_classname = "windows"; |
150 } else { | |
151 platform_friendly = platform.os.family; | |
152 platform_classname = platform_friendly.toLowerCase(); | |
150 } | 153 } |
151 } | 154 } |
152 | 155 |
153 if(platform_friendly && platform_classname) { | 156 if(platform_friendly && platform_classname) { |
157 if($('.client-card .client-platform-badge-'+platform_classname).length == 0) { | |
158 // No clients recognised for this platform, do nothing | |
159 return; | |
160 } | |
154 // Hide clients not for this platform | 161 // Hide clients not for this platform |
155 $('.client-card.app-platform-'+platform_classname).addClass("supported-platform"); | 162 $('.client-card.app-platform-'+platform_classname).addClass("supported-platform"); |
156 $('.client-card').not(".supported-platform").hide(); | 163 $('.client-card').not(".supported-platform").hide(); |
157 $('.client-card .client-platform-badge') | 164 $('.client-card .client-platform-badge') |
158 .not(".client-platform-badge-"+platform_classname) | 165 .not(".client-platform-badge-"+platform_classname) |