瀏覽代碼

Fixed private checkbox display.

Frederic G. MARAND 9 年之前
父節點
當前提交
7dc12ebbbd
共有 2 個文件被更改,包括 11 次插入7 次删除
  1. 7 7
      textcircle.html
  2. 4 0
      textcircle.js

+ 7 - 7
textcircle.html

@@ -71,14 +71,14 @@
 <template name="docMeta">
   {{#with document }}
     <span class="h1">{{> editableText collection="documents" field="title" }}</span>
+    {{#if canEdit }}
+      <div class="checkbox">
+        <label>
+          <input type="checkbox" class="js-tog-private" checked="{{ isPrivate }}"/>Private
+        </label>
+      </div>
+    {{/if}}
   {{/with}}
-  {{#if canEdit }}
-    <div class="checkbox">
-      <label>
-        <input type="checkbox" class="js-tog-private" />Private
-      </label>
-    </div>
-  {{/if}}
 </template>
 
 <template name="editingUsers">

+ 4 - 0
textcircle.js

@@ -69,6 +69,10 @@ if (Meteor.isClient) {
     canEdit: function () {
       let doc = Documents.findOne({ _id: Session.get("docid") });
       return doc && doc.owner === Meteor.userId();
+    },
+    isPrivate: function () {
+      let doc = Documents.findOne({ _id: Session.get("docid") });
+      return !!(doc.isPrivate);
     }
   });