소스 검색

locked rooms only visible to admins

Akira 9 년 전
부모
커밋
65173ef06d
1개의 변경된 파일12개의 추가작업 그리고 0개의 파일을 삭제
  1. 12 0
      app/client/client.js

+ 12 - 0
app/client/client.js

@@ -351,6 +351,18 @@ Template.dashboard.onCreated(function() {
     Session.set("type", undefined);
 });
 
+Template.dashboard.onRendered(function(){
+    Rooms.find().fetch().forEach(function(room){
+        if(room.private === true){
+            $(".station h3").each(function(i, el){
+                if($(el).text() === room.display){
+                    $(el).parent().css("display", "none");
+                }
+            })
+        }
+    })
+})
+
 function executeCommand(command, params){
     if (command === "help" || command === "commands") {
         $('#helpModal').modal('show');