add polling for developer view
authorScott Baker <smbaker@gmail.com>
Mon, 14 Jul 2014 01:02:09 +0000 (18:02 -0700)
committerScott Baker <smbaker@gmail.com>
Mon, 14 Jul 2014 01:02:09 +0000 (18:02 -0700)
planetstack/core/xoslib/static/js/xosDeveloper.js
planetstack/core/xoslib/static/js/xoslib/xos-backbone.js

index eb83efe..6ea2d59 100644 (file)
@@ -33,7 +33,7 @@ DeveloperApp.on("start", function() {
   });\r
   console.log(developerSliceListView);\r
   DeveloperApp.mainRegion.show(developerSliceListView);\r
-  xos.slicesPlus.fetch();\r
+  xos.slicesPlus.startPolling(); //fetch();\r
 });
 
 $(document).ready(function(){
index 59645e7..fe918ea 100644 (file)
@@ -51,6 +51,15 @@ XOSCollection = Backbone.Collection.extend({
                 return this.models.map(function(element) { return element.attributes; });
              },
 
+    startPolling: function() {
+        if (!this._polling) {
+            collection=this;
+            setInterval(function() { console.log(collection); collection.fetch(); }, 10000);
+            this._polling=true;
+            this.fetch();
+        }
+    },
+
     maybeFetch: function(options){
             // Helper function to fetch only if this collection has not been fetched before.
         if(this._fetched){