← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 16017: ER gui expand/resize/scroll behaviour.

 

Merge authors:
  Jan Henrik Øverland (janhenrik-overland)
------------------------------------------------------------
revno: 16017 [merge]
committer: Jan Henrik Overland <janhenrik.overland@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2014-07-08 14:27:50 +0200
message:
  ER gui expand/resize/scroll behaviour.
modified:
  dhis-2/dhis-web/dhis-web-event-reports/src/main/webapp/dhis-web-event-reports/app/scripts/app.js
  dhis-2/dhis-web/dhis-web-event-reports/src/main/webapp/dhis-web-event-reports/app/scripts/core.js
  dhis-2/dhis-web/dhis-web-event-reports/src/main/webapp/dhis-web-event-reports/app/styles/style.css
  dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/app/scripts/app.js


--
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-event-reports/src/main/webapp/dhis-web-event-reports/app/scripts/app.js'
--- dhis-2/dhis-web/dhis-web-event-reports/src/main/webapp/dhis-web-event-reports/app/scripts/app.js	2014-07-07 19:06:50 +0000
+++ dhis-2/dhis-web/dhis-web-event-reports/src/main/webapp/dhis-web-event-reports/app/scripts/app.js	2014-07-08 12:26:31 +0000
@@ -3801,7 +3801,10 @@
             listeners: {
 				added: function(cmp) {
 					accordionPanels.push(cmp);
-				}
+				},
+                expand: function(cmp) {
+                    cmp.onExpand();
+                }
 			}
         });
 
@@ -4467,7 +4470,10 @@
 			listeners: {
 				added: function() {
 					accordionPanels.push(this);
-				}
+				},
+                expand: function(cmp) {
+                    cmp.onExpand();
+                }
 			}
 		});
 
@@ -4937,7 +4943,10 @@
             listeners: {
 				added: function(cmp) {
 					accordionPanels.push(cmp);
-				}
+				},
+                expand: function(cmp) {
+                    cmp.onExpand();
+                }
 			}
         });
 
@@ -5165,7 +5174,7 @@
 					}
 
 					var h = ns.app.westRegion.hasScrollbar ?
-						ns.core.conf.layout.west_scrollbarheight_accordion_group : ns.core.conf.layout.west_maxheight_accordion_group;
+						ns.core.conf.layout.west_scrollbarheight_accordion_dataset : ns.core.conf.layout.west_maxheight_accordion_dataset;
 					accordion.setThisHeight(h);
 					ns.core.web.multiSelect.setHeight(
 						[available, selected],
@@ -5231,9 +5240,9 @@
             }(),
             listeners: {
                 afterrender: function() { // nasty workaround, should be fixed
-                    organisationUnit.expand();
-                    period.expand();
-                    data.expand();
+                    //organisationUnit.expand();
+                    //period.expand();
+                    //data.expand();
                 }
             }
 		});
@@ -5491,27 +5500,30 @@
             accordionBody: accordionBody,
 			items: accordionBody,
 			panels: accordionPanels,
-
+            expandInitPanels: function() {
+                organisationUnit.expand();
+                //period.expand();
+                data.expand();
+            },
 			map: layer ? layer.map : null,
 			layer: layer ? layer : null,
 			menu: layer ? layer.menu : null,
 
 			setThisHeight: function(mx) {
 				var settingsHeight = 41,
-					panelHeight = settingsHeight + this.panels.length * 28,
-					height;
+					containerHeight = settingsHeight + (this.panels.length * 28) + mx,
+					accordionHeight = ns.app.westRegion.getHeight() - settingsHeight - ns.core.conf.layout.west_fill,
+                    accordionBodyHeight;
 
 				if (ns.app.westRegion.hasScrollbar) {
-					height = panelHeight + mx;
-					this.setHeight(viewport.getHeight() - settingsHeight - 2);
-					accordionBody.setHeight(height - settingsHeight - 2);
+                    accordionBodyHeight = containerHeight - settingsHeight - ns.core.conf.layout.west_fill;
 				}
 				else {
-					height = ns.app.westRegion.getHeight() - ns.core.conf.layout.west_fill - settingsHeight;
-					mx += panelHeight;
-					this.setHeight((height > mx ? mx : height) - 2);
-					accordionBody.setHeight((height > mx ? mx : height) - 2);
+                    accordionBodyHeight = (accordionHeight > containerHeight ? containerHeight : accordionHeight) - ns.core.conf.layout.west_fill;
 				}
+
+                this.setHeight(accordionHeight);
+                accordionBody.setHeight(accordionBodyHeight);
 			},
 			getExpandedPanel: function() {
 				for (var i = 0, panel; i < this.panels.length; i++) {
@@ -5642,16 +5654,21 @@
 				}
 			};
 
-			web.multiSelect.setHeight = function(multiSelects, panel, fill) {
-                fill = fill || 0;
-
-
-				for (var i = 0, height, ms, hasToolbar; i < multiSelects.length; i++) {
-                    ms = multiSelects[i];
-                    hasToolbar = Ext.isArray(ms.tbar) && ms.tbar.length;
-
-					height = panel.getHeight() - 4 - fill - (hasToolbar ? 27 : 0);
-					ms.setHeight(height);
+			web.multiSelect.setHeight = function(ms, panel, fill) {
+                //fill = fill || 0;
+
+				//for (var i = 0, height, ms, hasToolbar; i < multiSelects.length; i++) {
+                    //ms = multiSelects[i];
+                    //hasToolbar = Ext.isArray(ms.tbar) && ms.tbar.length;
+
+					//height = panel.getHeight() - 4 - fill - (hasToolbar ? 27 : 0);
+					//ms.setHeight(height);
+				//}
+
+				for (var i = 0, height; i < ms.length; i++) {
+					height = panel.getHeight() - fill - (ms[i].hasToolbar ? 25 : 0);
+console.log("panel.getHeight()", panel.getHeight(), "fill", fill, "pluss", ms[i].hasToolbar ? 25 : 0, "MS HEIGHT", height);
+					ms[i].setHeight(height);
 				}
 			};
 
@@ -6354,7 +6371,7 @@
         paramButtonMap[caseButton.param] = caseButton;
 
 		typeToolbar = Ext.create('Ext.toolbar.Toolbar', {
-			style: 'padding:1px; background:#fff; border:0 none',
+			style: 'padding:1px; background:#fbfbfb; border:0 none',
             height: 41,
             getType: function() {
 				return aggregateButton.pressed ? aggregateButton.param : caseButton.param;
@@ -6945,8 +6962,8 @@
 						westRegion.hasScrollbar = true;
 					}
 
-					// expand first panel
-					accordion.getFirstPanel().expand();
+					// expand init panels
+					accordion.expandInitPanels();
 
 					// look for url params
 					var id = ns.core.web.url.getParam('id'),

=== modified file 'dhis-2/dhis-web/dhis-web-event-reports/src/main/webapp/dhis-web-event-reports/app/scripts/core.js'
--- dhis-2/dhis-web/dhis-web-event-reports/src/main/webapp/dhis-web-event-reports/app/scripts/core.js	2014-07-07 18:30:38 +0000
+++ dhis-2/dhis-web/dhis-web-event-reports/src/main/webapp/dhis-web-event-reports/app/scripts/core.js	2014-07-08 12:16:55 +0000
@@ -129,18 +129,20 @@
 			conf.layout = {
 				west_width: 452,
 				west_fill: 2,
-				west_fill_accordion_indicator: 59,
-				west_fill_accordion_dataset: 33,
-				west_fill_accordion_period: 293,
-				west_fill_accordion_organisationunit: 58,
-				west_maxheight_accordion_indicator: 500,
-				west_maxheight_accordion_dataset: 400,
-				west_maxheight_accordion_period: 540,
-				west_maxheight_accordion_organisationunit: 900,
-				west_scrollbarheight_accordion_indicator: 500,
-				west_scrollbarheight_accordion_dataset: 300,
-				west_scrollbarheight_accordion_period: 475,
-				west_scrollbarheight_accordion_organisationunit: 450,
+                west_fill_accordion_indicator: 56,
+                west_fill_accordion_dataelement: 59,
+                west_fill_accordion_dataset: 31,
+                west_fill_accordion_period: 307,
+                west_fill_accordion_organisationunit: 58,
+                //west_maxheight_accordion_indicator: 350,
+                west_maxheight_accordion_indicator: 450,
+                west_maxheight_accordion_dataset: 350,
+                west_maxheight_accordion_period: 405,
+                west_maxheight_accordion_organisationunit: 500,
+                west_scrollbarheight_accordion_indicator: 300,
+                west_scrollbarheight_accordion_dataset: 250,
+                west_scrollbarheight_accordion_period: 405,
+                west_scrollbarheight_accordion_organisationunit: 350,
 				east_tbar_height: 31,
 				east_gridcolumn_height: 30,
 				form_label_width: 55,

=== modified file 'dhis-2/dhis-web/dhis-web-event-reports/src/main/webapp/dhis-web-event-reports/app/styles/style.css'
--- dhis-2/dhis-web/dhis-web-event-reports/src/main/webapp/dhis-web-event-reports/app/styles/style.css	2014-07-03 15:01:59 +0000
+++ dhis-2/dhis-web/dhis-web-event-reports/src/main/webapp/dhis-web-event-reports/app/styles/style.css	2014-07-08 11:18:47 +0000
@@ -82,12 +82,12 @@
 
 ::-webkit-scrollbar-track:vertical {
     background-color: #e1e1e1;
-    margin: 2px 0;
-    border-right: 2px solid white;
+    margin: 1px 0;
+    border-right: 1px solid white;
 }
 ::-webkit-scrollbar-thumb:vertical {
 	background-color: #bbb;
-    border-right: 2px solid white;
+    border-right: 1px solid white;
 }
 
 	/* User select */

=== modified file 'dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/app/scripts/app.js'
--- dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/app/scripts/app.js	2014-06-26 14:37:15 +0000
+++ dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/app/scripts/app.js	2014-07-08 11:10:49 +0000
@@ -6011,7 +6011,7 @@
 								requests.push({
 									url: init.contextPath + '/api/dimensions.json?links=false&paging=false',
 									success: function(r) {
-										init.dimensions = Ext.decode(r.responseText).dimensions || [];
+                                        init.dimensions = Ext.decode(r.responseText).dimensions || [];                                        
 										fn();
 									}
 								});