sync
[web.mtrack] / MTrackWeb / templates / images / js / mtrack2.js
index eef81c1..cfcfe61 100644 (file)
@@ -15,9 +15,9 @@ MTrack = {
     {
         
         Roo.onReady(function () {
-            MTrack.footerSetAndWait();
+            //MTrack.footerSetAndWait();
             if (authUser) {
-                setTimeout(MTrack.keepLoggedIn, 30000);
+                window.setTimeout(MTrack.keepLoggedIn, 30000);
                 
             }
             
@@ -72,7 +72,7 @@ MTrack = {
         // forEach? - no IE support?
         toWhat = toWhat || document.body; // 
         // run the main registry
-        MTrack.registry.forEach(function(cfg) {
+        Roo.each(MTrack.registry, function(cfg) {
             //Roo.log("Add select:" + cfg.selector);
             try { 
                 var el = Roo.get(toWhat).select(cfg.selector,true)
@@ -114,6 +114,7 @@ MTrack = {
     
     ajaxLoad : function(url,slideleft)
     { 
+        Roo.get(document.body).scrollTo('top',0,true);
         this.currentURL = url;
         var target = Roo.get("ajaxbody");
         var content = Roo.get("content");
@@ -179,6 +180,8 @@ MTrack = {
                         
                         MTrack.missingHashes(target,  url);
                         MTrack.addHandlers(target);
+                        // scroll up...
+                        
                     },
                      'easeOut', 'motion'
                 );
@@ -233,6 +236,7 @@ MTrack = {
     last_wh : false,
    
     footerPosition : function (force) {
+        return;
         var ele = Roo.get('footer');
         if (!force &&
             (MTrack.last_dh != Roo.lib.Dom.getDocumentHeight() || MTrack.last_wh != Roo.lib.Dom.getViewHeight())) {
@@ -268,6 +272,26 @@ MTrack = {
         MTrack.last_wh = Roo.lib.Dom.getViewHeight();
     },
     
+    
+    keepLoggedIn: function()
+    {
+        Roo.Ajax.request({
+            url : baseURL + '/Login.html',
+            method:  'POST',
+            data : { refresh : 1 },
+            success : function() {
+                
+                window.setTimeout(MTrack.keepLoggedIn, 30000);
+                // what if it's false..currentURL = false;
+                
+                
+            }
+            
+        })
+        
+        
+        
+    },
       /*
       
        $(window)
@@ -277,10 +301,12 @@ MTrack = {
       */
         
     footerSetAndWait : function () {
-        this.footerPosition();
-        setTimeout(function () {
+        return;
+        /*this.footerPosition();
+        window.setTimeout(function () {
           MTrack.footerSetAndWait();
         }, 1500);
+        */
     }
     
     
@@ -296,7 +322,7 @@ Roo.onReady(function() {
         // ajax change project, and refresh body..
         Roo.Ajax.request({
             method: 'GET',
-            url : baseURL + '/Project.html',
+            url : baseURL + '/core_project',
             params : { active_project_id : this.value },
             success : function() {
                 // what if it's false..currentURL = false;
@@ -405,7 +431,7 @@ $(document).ready(function() {
       {separator:'---------------' },
       {name:'Quotes', openWith:'(!(> |!|>)!)'},
       {name:'Code', openWith:'{{{\\n', closeWith:'\\n}}}'},
-      {separator:'---------------' },
+      {separator:'---------------' },1
       {name:'Preview', call:'preview', className:'preview'}
     ]
   });