Commits

singli committed d65e7dc

removed direct Deps.autorun call; updated buildzip against master; tested on latest shark branch

  • Participants
  • Parent commits cd9fc51

Comments (0)

Files changed (5)

 . clean.sh
-COPYFILE_DISABLE=1 tar czf sales_nologin.tgz  --exclude='**/.meteor' sales_nologin 
-COPYFILE_DISABLE=1 tar czf sales.tgz  --exclude='**/.meteor' sales
-COPYFILE_DISABLE=1 tar czf fotoshare.tgz  --exclude='**/.meteor' fotoshare
+cd sales_nologin 
+COPYFILE_DISABLE=1 tar czf ../sales_nologin.tgz  --exclude='./.meteor' . 
+cd ../sales
+COPYFILE_DISABLE=1 tar czf ../sales.tgz  --exclude='./.meteor' .
+cd ../fotoshare
+COPYFILE_DISABLE=1 tar czf ../fotoshare.tgz  --exclude='./.meteor' .
+cd ..
 zip code4meteor`cat meteor_version_required.txt`.zip ./*.xlsx  ./*.tgz ./*.txt ./instcode.sh

File sales/client/sales.html

           </div>
           <div class="span5">
             <div style="float: right">
-              {{>loginButtons align="right"}}
+              {{> loginButtons align="right" }}
             </div>
           </div>
     </div>
 <template name="datapoint">
   <div class="datapoint {{selected}}">
     <span class="region">{{region}}</span>
-    <span class="sales editable">{{total}}</span>
+    <span class="sales editable {{updated}}">{{total}}</span>
   </div>
-</template>
+</template>

File sales/client/sales.js

 
 Sales2013 = new Meteor.Collection("regional_sales");
 
+var salesdataRendered = false;
 Meteor.subscribe("global_sales");
 
 Template.salesdata.dataset = function () {
     }
   };
 
-function setDeps ()  {
- Deps.autorun(function()  {
- plotit(Sales2013.find({}));
- });
-}
-
 
 function plotit(cur)  {
  if (cur.count() === 0)  // do not render pie if no data
   );   
 
 }
+Template.datapoint.updated = function()
+{
 
+ plotit(Sales2013.find({}));
+}
 Template.salesdata.rendered = function()
 {
  
  });
  
  plotit(Sales2013.find({}));
-
+ salesdataRendered = true;
  
-setDeps();
 
 
 }

File sales_nologin/sales.html

 <template name="datapoint">
   <div class="datapoint {{selected}}">
     <span class="region">{{region}}</span>
-    <span class="sales editable">{{total}}</span>
+    <span class="sales editable {{updated}}">{{total}}</span>
   </div>
-</template>
+</template>

File sales_nologin/sales.js

     }
   };
 
-function setDeps ()  {
- Deps.autorun(function()  {
- plotit(Sales2013.find({}));
- });
-}
-
-
+var salesdataRendered = false;
 function plotit(cur)  {
  if (cur.count() === 0)  // do not render pie if no data
        return;
   );   
 
 }
+Template.datapoint.updated = function()
+{
+ console.log("datavalue updated\n");
+ if (salesdataRendered) {
 
+ plotit(Sales2013.find({}));
+ }
+}
+Template.datapoint.rendered = function()
+{
+console.log("datapoint rendered\n");
+};
 Template.salesdata.rendered = function()
 {
+console.log("salesdata  rendered\n");
  
   $('.editable').editable(function(value, settings) { 
      console.log(this);
  plotit(Sales2013.find({}));
 
  
-setDeps();
+   salesdataRendered = true;
 
 
 }