← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 7787: (DV) Expanding relevant data panel when loading favorites.

 

Merge authors:
  Jan Henrik Øverland (janhenrik-overland)
------------------------------------------------------------
revno: 7787 [merge]
committer: Jan Henrik Overland <janhenrik.overland@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2012-07-31 12:34:33 +0200
message:
  (DV) Expanding relevant data panel when loading favorites.
modified:
  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-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	2012-07-31 10:17:43 +0000
+++ dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/app/scripts/app.js	2012-07-31 10:33:22 +0000
@@ -1575,7 +1575,8 @@
 							return;
 						}
 						
-						var f = Ext.JSON.decode(r.responseText);
+						var f = Ext.JSON.decode(r.responseText),
+							expand = true;
 						
 						if (!this.validation.favorite(f)) {
 							return;
@@ -1596,18 +1597,30 @@
                         if (f.indicators) {
 							for (var i = 0; i < f.indicators.length; i++) {
 								DV.c.indicator.records.push({id: f.indicators[i].id, name: DV.conf.util.jsonEncodeString(f.indicators[i].name)});
+							}							
+							if (expand) {
+								DV.cmp.dimension.indicator.panel.expand();
+								expand = false;
 							}
 						}
 						
 						if (f.dataElements) {
 							for (var i = 0; i < f.dataElements.length; i++) {
 								DV.c.dataelement.records.push({id: f.dataElements[i].id, name: DV.conf.util.jsonEncodeString(f.dataElements[i].name)});
+							}						
+							if (expand) {
+								DV.cmp.dimension.dataelement.panel.expand();
+								expand = false;
 							}
 						}
 						
 						if (f.dataSets) {
 							for (var i = 0; i < f.dataSets.length; i++) {
 								DV.c.dataset.records.push({id: f.dataSets[i].id, name: DV.conf.util.jsonEncodeString(f.dataSets[i].name)});
+							}						
+							if (expand) {
+								DV.cmp.dimension.dataset.panel.expand();
+								expand = false;
 							}
 						}