dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #21645
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 10296: (PT) Minor scrollbar + favorite issues fixed.
Merge authors:
Jan Henrik Øverland (janhenrik-overland)
------------------------------------------------------------
revno: 10296 [merge]
committer: Jan Henrik Overland <janhenrik.overland@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2013-03-18 21:28:54 +0100
message:
(PT) Minor scrollbar + favorite issues fixed.
modified:
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/core.js
dhis-2/dhis-web/dhis-web-pivot/src/main/webapp/dhis-web-pivot/app/styles/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-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 2013-03-18 15:58:24 +0000
+++ dhis-2/dhis-web/dhis-web-pivot/src/main/webapp/dhis-web-pivot/app/scripts/app.js 2013-03-18 20:15:47 +0000
@@ -60,17 +60,17 @@
no = pt.init.ougs.length + pt.init.degs.length,
factor = 0;
- console.log("westRegion.getHeight", vph);
- console.log("no of degs and ougs", no);
-
if (vph > 535) {
- var factor = (vph - 535) / 27;
- console.log("factor", factor);
+ var factor = (vph - 535) / 28;
}
if (factor > 7) {
- pt.viewport.accordion.setAutoScroll(false);
- pt.viewport.westRegion.setWidth(pt.conf.layout.west_width);
+ if (!Ext.isIE) {
+ pt.viewport.accordion.setAutoScroll(false);
+ pt.viewport.westRegion.setWidth(pt.conf.layout.west_width);
+ pt.viewport.accordion.getEl().setStyle('margin-right', '2px');
+ pt.viewport.accordion.doLayout();
+ }
}
else {
pt.viewport.westRegion.hasScrollbar = true;
@@ -280,6 +280,7 @@
r.data.name = pt.conf.util.jsonEncodeString(r.data.name);
});
pt.util.store.addToStorage(s);
+ pt.util.multiselect.filterAvailable({store: s}, {store: store.indicatorSelected});
}
}
});
@@ -309,6 +310,7 @@
r.data.name = pt.conf.util.jsonEncodeString(r.data.name);
});
pt.util.store.addToStorage(s);
+ pt.util.multiselect.filterAvailable({store: s}, {store: store.dataElementSelected});
}
}
});
@@ -340,6 +342,7 @@
r.data.name = pt.conf.util.jsonEncodeString(r.data.name);
});
pt.util.store.addToStorage(s);
+ pt.util.multiselect.filterAvailable({store: s}, {store: store.dataSetSelected});
}
}
});
@@ -803,7 +806,7 @@
hideEmptyRows = Ext.create('Ext.form.field.Checkbox', {
boxLabel: 'Hide empty rows', //i18n
- style: 'margin-bottom:4px',
+ style: 'margin-bottom:4px'
});
pt.viewport.hideEmptyRows = hideEmptyRows;
@@ -1079,7 +1082,7 @@
favorite.relativePeriods = {};
}
- // Setup
+ // Layout
if (pt.xLayout.col) {
var a = [];
@@ -1087,7 +1090,7 @@
a.push(pt.xLayout.col[i].dimensionName);
}
- favorite['columnDimensions'] = a;
+ favorite.columnDimensions = a;
}
if (pt.xLayout.row) {
@@ -1097,7 +1100,7 @@
a.push(pt.xLayout.row[i].dimensionName);
}
- favorite['rowDimensions'] = a;
+ favorite.rowDimensions = a;
}
if (pt.xLayout.filter) {
@@ -1107,7 +1110,7 @@
a.push(pt.xLayout.filter[i].dimensionName);
}
- favorite['filterDimensions'] = a;
+ favorite.filterDimensions = a;
}
}
@@ -1873,7 +1876,8 @@
userOrganisationUnitChildren,
treePanel,
organisationUnit,
- groupSetIdStoreMap,
+ groupSetIdAvailableStoreMap,
+ groupSetIdSelectedStoreMap,
getGroupSetPanels,
validateSpecialCases,
update,
@@ -3160,7 +3164,8 @@
}
};
- groupSetIdStoreMap = {};
+ groupSetIdAvailableStoreMap = {};
+ groupSetIdSelectedStoreMap = {};
getGroupSetPanels = function(groupSets, objectName, iconCls) {
var getAvailableStore,
@@ -3178,6 +3183,11 @@
sortStore: function() {
this.sort('name', 'ASC');
},
+ reload: function() {
+ this.removeAll();
+ this.storage = {};
+ this.loadData(groupSet.items);
+ },
listeners: {
load: function(s) {
s.isLoaded = true;
@@ -3294,7 +3304,8 @@
availableStore = getAvailableStore(groupSet);
selectedStore = getSelectedStore();
- groupSetIdStoreMap[groupSet.id] = selectedStore;
+ groupSetIdAvailableStoreMap[groupSet.id] = availableStore;
+ groupSetIdSelectedStoreMap[groupSet.id] = selectedStore;
available = getAvailable(availableStore);
selected = getSelected(selectedStore);
@@ -3464,8 +3475,11 @@
});
accordion = Ext.create('Ext.panel.Panel', {
- //xtype: 'panel',
- bodyStyle: 'border-style:none; padding:2px; padding-bottom:0; overflow-y:scroll',
+ bodyStyle: function() {
+ var style = 'border-style:none; padding:2px; padding-bottom:0; overflow-y:scroll;';
+ style += Ext.isWebKit ? ' padding-right:0;' : '';
+ return style;
+ }(),
layout: 'fit',
items: accordionBody,
listeners: {
@@ -3480,7 +3494,7 @@
preventHeader: true,
collapsible: true,
collapseMode: 'mini',
- width: pt.conf.layout.west_width + 13,
+ width: Ext.isWebKit ? pt.conf.layout.west_width + 7 : pt.conf.layout.west_width + 17,
items: accordion
});
@@ -3668,12 +3682,6 @@
// Relative periods
if (Ext.isObject(r.relativePeriods)) {
-
- //todo
- r.relativePeriods.reportingMonth = r.relativePeriods.lastMonth;
- r.relativePeriods.reportingBimonth = r.relativePeriods.lastBimonth;
- r.relativePeriods.reportingQuarter = r.relativePeriods.lastQuarter;
-
for (var key in r.relativePeriods) {
if (r.relativePeriods.hasOwnProperty(key) && pt.conf.period.relativePeriodParamKeys.hasOwnProperty(key)) {
var value = pt.conf.period.relativePeriodParamKeys[key];
@@ -3699,12 +3707,25 @@
userOrganisationUnit.setValue(r.userOrganisationUnit);
userOrganisationUnitChildren.setValue(r.userOrganisationUnitChildren);
+ // Reset groupset stores
+ for (var key in groupSetIdSelectedStoreMap) {
+ if (groupSetIdSelectedStoreMap.hasOwnProperty(key)) {
+ var a = groupSetIdAvailableStoreMap[key],
+ s = groupSetIdSelectedStoreMap[key];
+
+ if (s.getCount() > 0) {
+ a.reload();
+ s.removeAll();
+ }
+ }
+ }
+
// Organisation unit group sets
if (Ext.isObject(r.organisationUnitGroupSets)) {
for (var key in r.organisationUnitGroupSets) {
if (r.organisationUnitGroupSets.hasOwnProperty(key)) {
- groupSetIdStoreMap[key].removeAll();
- groupSetIdStoreMap[key].add(r.organisationUnitGroupSets[key]);
+ groupSetIdSelectedStoreMap[key].add(r.organisationUnitGroupSets[key]);
+ pt.util.multiselect.filterAvailable({store: groupSetIdAvailableStoreMap[key]}, {store: groupSetIdSelectedStoreMap[key]});
}
}
}
@@ -3713,8 +3734,8 @@
if (Ext.isObject(r.dataElementGroupSets)) {
for (var key in r.dataElementGroupSets) {
if (r.dataElementGroupSets.hasOwnProperty(key)) {
- groupSetIdStoreMap[key].removeAll();
- groupSetIdStoreMap[key].add(r.dataElementGroupSets[key]);
+ groupSetIdSelectedStoreMap[key].add(r.dataElementGroupSets[key]);
+ pt.util.multiselect.filterAvailable({store: groupSetIdAvailableStoreMap[key]}, {store: groupSetIdSelectedStoreMap[key]});
}
}
}
@@ -3728,30 +3749,40 @@
if (Ext.isArray(r.columnDimensions)) {
for (var i = 0, dim; i < r.columnDimensions.length; i++) {
dim = pt.conf.finals.dimension.objectNameMap[r.columnDimensions[i]];
+
pt.viewport.colStore.add({
id: dim.dimensionName,
name: dim.name
});
+
+ pt.viewport.dimensionStore.remove(pt.viewport.dimensionStore.getById(dim.dimensionName));
+
}
}
if (Ext.isArray(r.rowDimensions)) {
for (var i = 0, dim; i < r.rowDimensions.length; i++) {
dim = pt.conf.finals.dimension.objectNameMap[r.rowDimensions[i]];
+
pt.viewport.rowStore.add({
id: dim.dimensionName,
name: dim.name
});
+
+ pt.viewport.dimensionStore.remove(pt.viewport.dimensionStore.getById(dim.dimensionName));
}
}
if (Ext.isArray(r.filterDimensions)) {
for (var i = 0, dim; i < r.filterDimensions.length; i++) {
dim = pt.conf.finals.dimension.objectNameMap[r.filterDimensions[i]];
+
pt.viewport.filterStore.add({
id: dim.dimensionName,
name: dim.name
});
+
+ pt.viewport.dimensionStore.remove(pt.viewport.dimensionStore.getById(dim.dimensionName));
}
}
@@ -3780,7 +3811,7 @@
userOrganisationUnit: userOrganisationUnit,
userOrganisationUnitChildren: userOrganisationUnitChildren,
setFavorite: setFavorite,
- groupSetIdStoreMap: groupSetIdStoreMap,
+ //groupSetIdStoreMap: groupSetIdStoreMap,
items: [
westRegion,
centerRegion
@@ -3794,9 +3825,6 @@
}
}
});
-acc = accordion;
-
-wr = westRegion;
addListeners = function() {
pt.store.indicatorAvailable.on('load', function() {
@@ -3840,4 +3868,3 @@
PT.app.init.onInitialize(r);
}});
});
-
=== modified file 'dhis-2/dhis-web/dhis-web-pivot/src/main/webapp/dhis-web-pivot/app/scripts/core.js'
--- dhis-2/dhis-web/dhis-web-pivot/src/main/webapp/dhis-web-pivot/app/scripts/core.js 2013-03-18 15:45:33 +0000
+++ dhis-2/dhis-web/dhis-web-pivot/src/main/webapp/dhis-web-pivot/app/scripts/core.js 2013-03-18 18:48:35 +0000
@@ -153,15 +153,17 @@
'LAST_WEEK': 'lastWeek',
'LAST_4_WEEKS': 'last4Weeks',
'LAST_12_WEEKS': 'last12Weeks',
- 'LAST_MONTH': 'reportingMonth',
+ 'LAST_MONTH': 'lastMonth',
'LAST_3_MONTHS': 'last3Months',
'LAST_12_MONTHS': 'last12Months',
- 'LAST_BIMONTH': 'reportingBimonth',
+ 'LAST_BIMONTH': 'lastBimonth',
'LAST_6_BIMONTHS': 'last6BiMonths',
- 'LAST_QUARTER': 'reportingQuarter',
+ 'LAST_QUARTER': 'lastQuarter',
'LAST_4_QUARTERS': 'last4Quarters',
'LAST_SIX_MONTH': 'lastSixMonth',
'LAST_2_SIXMONTHS': 'last2SixMonths',
+ 'LAST_FINANCIAL_YEAR': 'lastFinancialYear',
+ 'LAST_5_FINANCIAL_YEARS': 'last5FinancialYears',
'THIS_YEAR': 'thisYear',
'LAST_YEAR': 'lastYear',
'LAST_5_YEARS': 'last5Years'
@@ -170,15 +172,17 @@
'lastWeek': 'LAST_WEEK',
'last4Weeks': 'LAST_4_WEEKS',
'last12Weeks': 'LAST_12_WEEKS',
- 'reportingMonth': 'LAST_MONTH',
+ 'lastMonth': 'LAST_MONTH',
'last3Months': 'LAST_3_MONTHS',
'last12Months': 'LAST_12_MONTHS',
- 'reportingBimonth': 'LAST_BIMONTH',
+ 'lastBimonth': 'LAST_BIMONTH',
'last6BiMonths': 'LAST_6_BIMONTHS',
- 'reportingQuarter': 'LAST_QUARTER',
+ 'lastQuarter': 'LAST_QUARTER',
'last4Quarters': 'LAST_4_QUARTERS',
'lastSixMonth': 'LAST_SIX_MONTH',
'last2SixMonths': 'LAST_2_SIXMONTHS',
+ 'lastFinancialYear': 'LAST_FINANCIAL_YEAR',
+ 'last5FinancialYears': 'LAST_5_FINANCIAL_YEARS',
'thisYear': 'THIS_YEAR',
'lastYear': 'LAST_YEAR',
'last5Years': 'LAST_5_YEARS'
=== modified file 'dhis-2/dhis-web/dhis-web-pivot/src/main/webapp/dhis-web-pivot/app/styles/style.css'
--- dhis-2/dhis-web/dhis-web-pivot/src/main/webapp/dhis-web-pivot/app/styles/style.css 2013-03-18 15:58:24 +0000
+++ dhis-2/dhis-web/dhis-web-pivot/src/main/webapp/dhis-web-pivot/app/styles/style.css 2013-03-18 18:32:28 +0000
@@ -65,32 +65,41 @@
-webkit-text-stroke: 0.2px #888;
}
- /* Scrollbar */
+ /* Scrollbar Webkit */
::-webkit-scrollbar {
- width: 13px;
+ width: 9px;
+ height: 9px;
border: 0 none;
}
-::-webkit-scrollbar-track {
- background-color: #ddd;
- border-radius: 1px;
+::-webkit-scrollbar-track:horizontal {
+ background-color: #ddd;
+ margin: 0 2px;
+ border-top: 2px solid white;
+ border-bottom: 2px solid white;
+}
+::-webkit-scrollbar-track:vertical {
+ background-color: #ddd;
margin: 2px 0;
- border-right: 3px solid white;
- border-left: 1px solid white;
+ border-right: 2px solid white;
+ border-left: 2px solid white;
}
-::-webkit-scrollbar-thumb {
- background-color: #bbb;
- border-radius: 1px;
- border-right: 3px solid white;
- border-left: 1px solid white;
+::-webkit-scrollbar-thumb:horizontal {
+ background-color: #bbb;
+ border-top: 2px solid white;
+ border-bottom: 2px solid white;
+}
+::-webkit-scrollbar-thumb:vertical {
+ background-color: #bbb;
+ border-right: 2px solid white;
+ border-left: 2px solid white;
}
.x-scroller-vertical {
border: 0 none;
}
-
/* Disable class invisible */
.pt-invisible .x-form-item-body {
display: none;