← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 5239: Minor fixed.

 

Merge authors:
  Jan Henrik Øverland (janhenrik-overland)
------------------------------------------------------------
revno: 5239 [merge]
committer: Jan Henrik Overland <janhenrik.overland@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2011-11-29 17:45:08 +0100
message:
  Minor fixed.
added:
  dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/app/images/reporttable.png
modified:
  dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/app/app.js
  dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/app/css/style.css


--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk

Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/app/app.js'
--- dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/app/app.js	2011-11-27 09:44:34 +0000
+++ dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/app/app.js	2011-11-29 16:43:52 +0000
@@ -109,15 +109,17 @@
     };
     
     DV.cmp = {
+        region: {},
         charttype: [],
         settings: {},
+        fieldset: {},
         dimension: {
             indicator: {},
             dataelement: {},
             period: []
         },
-        fieldset: {},
-        datatable: null
+        datatable: null,
+        toolbar: {}
     };
     
     DV.util = {
@@ -990,9 +992,8 @@
             }
         },
         reload: function() {
-            var c = DV.util.getCmp('panel[region="east"]');
-            c.removeAll(true);
-            c.add(this.datatable);
+            DV.cmp.region.east.removeAll(true);
+            DV.cmp.region.east.add(this.datatable);
         }            
     };
     
@@ -1750,13 +1751,16 @@
                     }
                 ],
                 listeners: {
-                    collapse: function(p) {                    
-                        p.collapsed = true;
-                        DV.util.getCmp('button[name="resizeleft"]').setText('>>>');
-                    },
-                    expand: function(p) {
-                        p.collapsed = false;
-                        DV.util.getCmp('button[name="resizeleft"]').setText('<<<');
+                    afterrender: function() {
+                        DV.cmp.region.west = this;
+                    },
+                    collapse: function() {                    
+                        this.collapsed = true;
+                        DV.util.getCmp('button[name="resizewest"]').setText('>>>');
+                    },
+                    expand: function() {
+                        this.collapsed = false;
+                        DV.util.getCmp('button[name="resizewest"]').setText('<<<');
                     }
                 }
             },
@@ -1772,11 +1776,11 @@
                         {
                             xtype: 'button',
 							cls: 'dv-btn-toolbar',
-                            name: 'resizeleft',
+                            name: 'resizewest',
                             text: '<span class="dv-btn-toolbar-text-2"><<<</span>',
                             tooltip: 'Show/hide chart settings',
                             handler: function() {
-                                var p = DV.util.getCmp('panel[region="west"]');
+                                var p = DV.cmp.region.west;
                                 if (p.collapsed) {
                                     p.expand();
                                 }
@@ -1796,15 +1800,38 @@
                         {
                             xtype: 'button',
 							cls: 'dv-btn-toolbar',
-                            text: '<span class="dv-btn-toolbar-text-2">Data table</span>',
-                            handler: function(b) {
-                                var p = DV.util.getCmp('panel[region="east"]');
-                                if (p.collapsed && p.items.length) {
-                                    p.expand();
-                                    DV.exe.datatable(true);
+                            text: '<span class="dv-btn-toolbar-text-2">Show..</span>',
+                            listeners: {
+                                afterrender: function(b) {
+                                    this.menu = Ext.create('Ext.menu.Menu', {
+                                        shadowOffset: 1,
+                                        items: [
+                                            {
+                                                text: 'Data table',
+                                                iconCls: 'dv-menu-item-datatable',
+                                                minWidth: 100,
+                                                handler: function() {
+                                                    var p = DV.cmp.region.east;
+                                                    if (p.collapsed && p.items.length) {
+                                                        p.expand();
+                                                        DV.exe.datatable(true);
+                                                    }
+                                                    else {
+                                                        p.collapse();
+                                                    }
+                                                    DV.cmp.toolbar.resizeeast.show();
+                                                }
+                                            }
+                                        ]                                            
+                                    });
+                                }
+                            },
+                            handler: function() {
+                                if (DV.cmp.region.east.items.length) {
+                                    this.menu.down('menuitem').enable();
                                 }
                                 else {
-                                    p.collapse();
+                                    this.menu.down('menuitem').disable();
                                 }
                             }
                         },
@@ -1837,10 +1864,11 @@
                             listeners: {
                                 afterrender: function(b) {
                                     this.menu = Ext.create('Ext.menu.Menu', {
+                                        shadowOffset: 1,
                                         items: [
                                             {
                                                 text: 'PNG',
-                                                iconCls: 'dv-menu-toolbar-save-png',
+                                                iconCls: 'dv-menu-item-png',
                                                 minWidth: 80,
                                                 handler: function() {
                                                     b.execute(DV.conf.finals.image.png);
@@ -1848,7 +1876,7 @@
                                             },
                                             {
                                                 text: 'PDF',
-                                                iconCls: 'dv-menu-toolbar-save-pdf',
+                                                iconCls: 'dv-menu-item-pdf',
                                                 minWidth: 80,
                                                 handler: function() {
                                                     b.execute(DV.conf.finals.image.pdf);
@@ -1867,6 +1895,23 @@
                             handler: function() {
                                 window.location.href = DV.conf.finals.ajax.url_portal + 'redirect.action';
                             }
+                        },
+                        {
+                            xtype: 'button',
+							cls: 'dv-btn-toolbar',
+                            name: 'resizeeast',
+                            text: '<span class="dv-btn-toolbar-text-2">>>></span>',
+                            tooltip: 'Hide data table',
+                            hidden: true,
+                            handler: function() {
+                                DV.cmp.region.east.collapse();
+                                this.hide();
+                            },
+                            listeners: {
+                                added: function() {
+                                    DV.cmp.toolbar.resizeeast = this;
+                                }
+                            }
                         }
                     
                     ]
@@ -1878,7 +1923,12 @@
                 collapsible: true,
                 collapsed: true,
                 collapseMode: 'mini',
-                width: 498
+                width: 498,
+                listeners: {
+                    afterrender: function() {
+                        DV.cmp.region.east = this;
+                    }
+                }
             }
         ],
         listeners: {

=== modified file 'dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/app/css/style.css'
--- dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/app/css/style.css	2011-11-26 18:37:52 +0000
+++ dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/app/css/style.css	2011-11-29 16:43:52 +0000
@@ -307,6 +307,16 @@
     border-color: #b3abaa;
 }
 
+/* Menu */
+.x-menu-body {
+    -moz-border-radius: 2px 2px 2px 2px;
+    -webkit-border-radius: 2px 2px 2px 2px;
+    -o-border-radius: 2px 2px 2px 2px;
+    -ms-border-radius: 2px 2px 2px 2px;
+    -khtml-border-radius: 2px 2px 2px 2px;
+    border-radius: 2px 2px 2px 2px;
+}
+
 /* Treepanel contextmenu */
 #treepanel-contextmenu {
     -moz-border-radius: 2px 2px 2px 2px;
@@ -334,7 +344,7 @@
     border-width: 1px;
     border-style: solid;
     border-color: #aaa;
-}    
+}
 
 /* Fieldset */
 .dv-fieldset-title-link {
@@ -387,10 +397,18 @@
     color: #444;
 }
 
-.dv-menu-toolbar-save-png {
+.dv-menu-item-png {
     background-image:url('../images/png.png');
 }
 
-.dv-menu-toolbar-save-pdf {
+.dv-menu-item-pdf {
     background-image:url('../images/pdf.png');
 }
+
+.dv-menu-item-datatable {
+    background-image:url('../images/datatable.png');
+}
+
+
+    
+

=== added file 'dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/app/images/reporttable.png'
Binary files dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/app/images/reporttable.png	1970-01-01 00:00:00 +0000 and dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/app/images/reporttable.png	2011-11-29 16:43:52 +0000 differ