]> git.proxmox.com Git - proxmox-widget-toolkit.git/blobdiff - data/UpdateStore.js
bump version to 1.0-16
[proxmox-widget-toolkit.git] / data / UpdateStore.js
index 4368835637e6b5ba545930d237ab76e00de9d143..b974c70e27a30d634b71cc4dcd564210b2f3d4c3 100644 (file)
@@ -17,8 +17,7 @@ Ext.define('Proxmox.data.UpdateStore', {
 
     destroy: function() {
        var me = this;
-       me.load_task.cancel();
-       Proxmox.data.UpdateQueue.unqueue(me);
+       me.stopUpdate();
        me.callParent();
     },
 
@@ -43,7 +42,9 @@ Ext.define('Proxmox.data.UpdateStore', {
            }
 
            if (Proxmox.Utils.authOK()) {
-               Proxmox.data.UpdateQueue.queue(me, function(runtime, success) {
+               var start = new Date();
+               me.load(function() {
+                   var runtime = (new Date()) - start;
                    var interval = config.interval + runtime*2;
                    load_task.delay(interval, run_load_task);
                });
@@ -55,12 +56,12 @@ Ext.define('Proxmox.data.UpdateStore', {
        Ext.apply(config, {
            startUpdate: function() {
                me.isStopped = false;
-               run_load_task();
+               // run_load_task(); this makes problems with chrome
+               load_task.delay(1, run_load_task);
            },
            stopUpdate: function() {
                me.isStopped = true;
                load_task.cancel();
-               Proxmox.data.UpdateQueue.unqueue(me);
            }
        });