[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

SF.net SVN: ledger-smb:[6109] trunk/UI/lib/TabularForm.js



Revision: 6109
          http://sourceforge.net/p/ledger-smb/code/6109
Author:   einhverfr
Date:     2013-10-05 09:43:29 +0000 (Sat, 05 Oct 2013)
Log Message:
-----------
TabularForm properly detects screen size on startup.  It does not respond to resize events (which require rewriting the inner HTML) but this is probably good enough for now.

Modified Paths:
--------------
    trunk/UI/lib/TabularForm.js

Modified: trunk/UI/lib/TabularForm.js
===================================================================
--- trunk/UI/lib/TabularForm.js	2013-10-03 09:23:28 UTC (rev 6108)
+++ trunk/UI/lib/TabularForm.js	2013-10-05 09:43:29 UTC (rev 6109)
@@ -77,7 +77,9 @@
         [TableContainer],
         {
         vertsize: 'mobile',
-        vertlabelsize: '',
+        vertlabelsize: 'mobile',
+        maxCols: 1,
+        initOrient: 'horiz',
         constructor: function (mixIn, domNode){
             if (domNode !== undefined){
                 // Number of columns
@@ -110,6 +112,8 @@
                  }); 
              });
             });
+            this.maxCols = this.cols;
+            this.initOrient = this.orientation;
         },
         TFRenderElement: function(dnode){
            var myself = this;
@@ -141,41 +145,49 @@
         },
         resize: function(){
             var winsize = win.getBox();
+            var orient = this.orientation;
             switch (this.vertlabelsize){
             case 'mobile':
-                if (winsize.h >= 480){
+                if (winsize.w >= 480){
+                   this.cols=this.maxCols;
+                   this.orientation=this.initOrient;
                    break;
                 }
             case 'small':
-                if (winsize.h >= 768){
+                if (winsize.w >= 768){
+                   this.cols=this.maxCols;
+                   this.orientation=this.initOrient;
                    break;
                 }
             case 'med':
-                if (winsize.h >= 992){
+                if (winsize.w >= 992){
+                   this.cols=this.maxCols;
+                   this.orientation=this.initOrient;
                    break;
                 }
             default:
                this.cols = 1;
                this.orientation = 'vert'; 
-            }
-            if (this.orientation == 'horiz'){
-               switch (this.vertsize){
-               case 'mobile':
-                if (winsize.h >= 480){
+            } 
+            switch (this.vertsize){
+            case 'mobile':
+                if (winsize.w >= 480){
                    break;
                 }
-               case 'small':
-                if (winsize.h >= 768){
+            case 'small':
+                if (winsize.w >= 768){
                    break;
                 }
-               case 'med':
-                if (winsize.h >= 992){
+            case 'med':
+                if (winsize.w >= 992){
                    break;
                 }
-               default:
+            default:
                 this.cols = 1;
-               };
-            }
+            } 
+            if (this.orientation !== orient){
+                this.startup();
+            } 
             return this.inherited(arguments);
         }
         });

This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.


------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from 
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60134791&iu=/4140/ostg.clktrk
_______________________________________________
Ledger-smb-commits mailing list
..hidden..
https://lists.sourceforge.net/lists/listinfo/ledger-smb-commits