← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 16368: PT DV layout win behaviour fix.

 

Merge authors:
  Jan Henrik Øverland (janhenrik-overland)
------------------------------------------------------------
revno: 16368 [merge]
committer: Jan Henrik Overland <janhenrik.overland@xxxxxxxxx>
branch nick: dhis2
timestamp: Sun 2014-08-10 15:53:14 +0200
message:
  PT DV layout win behaviour fix.
modified:
  dhis-2/dhis-web/dhis-web-pivot/src/main/webapp/dhis-web-pivot/app/scripts/app.js
  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-pivot/src/main/webapp/dhis-web-pivot/app/scripts/app.js'
--- dhis-2/dhis-web/dhis-web-pivot/src/main/webapp/dhis-web-pivot/app/scripts/app.js	2014-08-09 13:29:03 +0000
+++ dhis-2/dhis-web/dhis-web-pivot/src/main/webapp/dhis-web-pivot/app/scripts/app.js	2014-08-10 12:47:42 +0000
@@ -282,14 +282,10 @@
             if (!hasDimension(record.id)) {
                 store.add(record);
             }
-
-            if (store !== dimensionStore && dimensionStore.hasDimension(record.id)) {
-                dimensionStore.removeDimension(record.id);
-            }
         };
 
         removeDimension = function(dataElementId) {
-            var stores = [colStore, rowStore, filterStore];
+            var stores = [colStore, rowStore, filterStore, dimensionStore];
 
             for (var i = 0, store, index; i < stores.length; i++) {
                 store = stores[i];
@@ -302,7 +298,7 @@
         };
 
         hasDimension = function(id) {
-            var stores = [colStore, rowStore, filterStore];
+            var stores = [colStore, rowStore, filterStore, dimensionStore];
 
             for (var i = 0, store, index; i < stores.length; i++) {
                 if (stores[i].hasDimension(id)) {
@@ -4830,7 +4826,7 @@
                 if (selectedStore.getRange().length) {
                     win.addDimension({id: dimension.id, name: dimension.name});
                 }
-                else if (!selectedStore.getRange().length && win.hasDimension(dimension.id)) {
+                else if (win.hasDimension(dimension.id)) {
                     win.removeDimension(dimension.id);
                 }
             };

=== 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-08-10 09:04:43 +0000
+++ dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/app/scripts/app.js	2014-08-10 12:47:42 +0000
@@ -318,14 +318,10 @@
             if (!hasDimension(record.id)) {
                 store.add(record);
             }
-
-            if (store !== dimensionStore && dimensionStore.hasDimension(record.id)) {
-                dimensionStore.removeDimension(record.id);
-            }
         };
 
         removeDimension = function(dataElementId) {
-            var stores = [colStore, rowStore, filterStore];
+            var stores = [colStore, rowStore, filterStore, dimensionStore];
 
             for (var i = 0, store, index; i < stores.length; i++) {
                 store = stores[i];
@@ -338,7 +334,7 @@
         };
 
         hasDimension = function(id) {
-            var stores = [colStore, rowStore, filterStore];
+            var stores = [colStore, rowStore, filterStore, dimensionStore];
 
             for (var i = 0, store, index; i < stores.length; i++) {
                 if (stores[i].hasDimension(id)) {