Ver Fonte

W3.2: added Plus glyphicon and refactored navbar to template.

Frederic G. MARAND há 8 anos atrás
pai
commit
18bf30f03c
3 ficheiros alterados com 29 adições e 9 exclusões
  1. 1 0
      .gitignore
  2. 21 9
      textcircle.html
  3. 7 0
      textcircle.js

+ 1 - 0
.gitignore

@@ -1,3 +1,4 @@
+.DS_Store
 # Created by .ignore support plugin (hsz.mobi)
 ### Node template
 # Logs

+ 21 - 9
textcircle.html

@@ -3,15 +3,7 @@
 </head>
 
 <body>
-  <nav class="navbar navbar-default navbar-fixed-top">
-    <div class="container">
-      <a class="navbar-brand" href="#">TextCircle</a><!-- nav title -->
-      <p class="navbar-text navbar-right">
-        {{> loginButtons align="right" }}
-      </p>
-    </div><!-- /nav container -->
-  </nav><!-- /nav -->
-
+  {{> navbar }}
   <div class="container top-margin">
     <div class="row">
       <div class="col-md-12">
@@ -29,6 +21,26 @@
   </div>
 </body>
 
+<template name="navbar">
+  <nav class="navbar navbar-default navbar-fixed-top">
+    <div class="container">
+      <a class="navbar-brand" href="#">TextCircle</a><!-- nav title -->
+      <ul class="nav navbar-nav">
+        <li>
+          <a href="#" class="js-add-doc">
+            <span class="glyphicon glyphicon-plus" aria-hidden="true"></span>
+            New document
+          </a>
+        </li>
+      </ul>
+
+      <p class="navbar-text navbar-right">
+        {{> loginButtons align="right" }}
+      </p>
+    </div><!-- /nav container -->
+  </nav><!-- /nav -->
+</template>
+
 <template name="editor">
   <h2>doc id: {{ docid }}</h2>
   {{> sharejsCM docid=docid onRender=config id="editor" }}

+ 7 - 0
textcircle.js

@@ -52,6 +52,13 @@ if (Meteor.isClient) {
       return users;
     }
   });
+
+  Template.navbar.events({
+    "click .js-add-doc": function (event) {
+      event.preventDefault();
+      Meteor._debug("Add new doc", event, this);
+    }
+  });
 } // end isClient...
 
 if (Meteor.isServer) {