=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-reports/scripts/app.js' --- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-reports/scripts/app.js 2014-11-17 15:42:17 +0000 +++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-reports/scripts/app.js 2014-11-20 14:52:46 +0000 @@ -7060,6 +7060,18 @@ region: 'center', bodyStyle: 'padding:1px', autoScroll: true, + fullSize: true, + cmp: [defaultButton], + toggleCmp: function(show) { + for (var i = 0; i < this.cmp.length; i++) { + if (show) { + this.cmp[i].show(); + } + else { + this.cmp[i].hide(); + } + } + }, tbar: { defaults: { height: 26 @@ -7147,12 +7159,22 @@ }); b.menu.show(); + }, + listeners: { + render: function() { + centerRegion.cmp.push(this); + } } }, { xtype: 'tbseparator', height: 18, style: 'border-color:transparent; border-right-color:#d1d1d1; margin-right:4px', + listeners: { + render: function() { + centerRegion.cmp.push(this); + } + } }, { xtype: 'button', @@ -7184,6 +7206,18 @@ html += ''; p.update(html); + }, + resize: function() { + var width = this.getWidth(); + + if (width < 748 && this.fullSize) { + this.toggleCmp(false); + this.fullSize = false; + } + else if (width >= 748 && !this.fullSize) { + this.toggleCmp(true); + this.fullSize = true; + } } } }); === modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-visualizer/scripts/app.js' --- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-visualizer/scripts/app.js 2014-11-17 15:42:17 +0000 +++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-visualizer/scripts/app.js 2014-11-20 14:52:46 +0000 @@ -6702,6 +6702,18 @@ region: 'center', bodyStyle: 'padding:1px', autoScroll: true, + fullSize: true, + cmp: [defaultButton], + toggleCmp: function(show) { + for (var i = 0; i < this.cmp.length; i++) { + if (show) { + this.cmp[i].show(); + } + else { + this.cmp[i].hide(); + } + } + }, tbar: { defaults: { height: 26 @@ -6788,6 +6800,11 @@ }); b.menu.show(); + }, + listeners: { + render: function() { + centerRegion.cmp.push(this); + } } }, defaultButton, @@ -6795,6 +6812,11 @@ xtype: 'tbseparator', height: 18, style: 'border-color:transparent; border-right-color:#d1d1d1; margin-right:4px', + listeners: { + render: function() { + centerRegion.cmp.push(this); + } + } }, { xtype: 'button', @@ -6814,6 +6836,18 @@ if (ns.app.xLayout && ns.app.chart) { ns.app.chart.onViewportResize(); } + + // toolbar + var width = this.getWidth(); + + if (width < 748 && this.fullSize) { + this.toggleCmp(false); + this.fullSize = false; + } + else if (width >= 748 && !this.fullSize) { + this.toggleCmp(true); + this.fullSize = true; + } }, afterrender: function(p) { var liStyle = 'padding:3px 10px; color:#333', === modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-mapping/scripts/app.js' --- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-mapping/scripts/app.js 2014-11-17 15:42:17 +0000 +++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-mapping/scripts/app.js 2014-11-20 14:39:52 +0000 @@ -8748,8 +8748,17 @@ centerRegion = new GeoExt.panel.Map({ region: 'center', map: gis.olmap, - cmp: { - tbar: {} + fullSize: true, + cmp: [defaultButton], + toggleCmp: function(show) { + for (var i = 0; i < this.cmp.length; i++) { + if (show) { + this.cmp[i].show(); + } + else { + this.cmp[i].hide(); + } + } }, tbar: { defaults: { @@ -8913,6 +8922,11 @@ }); b.menu.show(); + }, + listeners: { + render: function() { + centerRegion.cmp.push(this); + } } }); @@ -8969,6 +8983,11 @@ }); b.menu.show(); + }, + listeners: { + render: function() { + centerRegion.cmp.push(this); + } } }); @@ -8978,6 +8997,11 @@ xtype: 'tbseparator', height: 18, style: 'border-color: transparent #d1d1d1 transparent transparent; margin-right: 6px; margin-left: 3px', + listeners: { + render: function() { + centerRegion.cmp.push(this); + } + } }); a.push({ @@ -8992,7 +9016,21 @@ return a; }() - } + }, + listeners: { + resize: function() { + var width = this.getWidth(); + + if (width < 800 && this.fullSize) { + this.toggleCmp(false); + this.fullSize = false; + } + else if (width >= 800 && !this.fullSize) { + this.toggleCmp(true); + this.fullSize = true; + } + } + } }); eastRegion = Ext.create('Ext.panel.Panel', { === modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-pivot/scripts/app.js' --- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-pivot/scripts/app.js 2014-11-19 16:30:33 +0000 +++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-pivot/scripts/app.js 2014-11-20 12:24:05 +0000 @@ -5812,6 +5812,18 @@ region: 'center', bodyStyle: 'padding:1px', autoScroll: true, + fullSize: true, + cmp: [defaultButton], + toggleCmp: function(show) { + for (var i = 0; i < this.cmp.length; i++) { + if (show) { + this.cmp[i].show(); + } + else { + this.cmp[i].hide(); + } + } + }, tbar: { defaults: { height: 26 @@ -5899,6 +5911,11 @@ }); b.menu.show(); + }, + listeners: { + render: function() { + centerRegion.cmp.push(this); + } } }, { @@ -5955,12 +5972,22 @@ }); b.menu.show(); + }, + listeners: { + render: function() { + centerRegion.cmp.push(this); + } } }, { xtype: 'tbseparator', height: 18, style: 'border-color:transparent; border-right-color:#d1d1d1; margin-right:4px', + listeners: { + render: function() { + centerRegion.cmp.push(this); + } + } }, { xtype: 'button', @@ -5991,6 +6018,18 @@ html += ''; p.update(html); + }, + resize: function() { + var width = this.getWidth(); + + if (width < 768 && this.fullSize) { + this.toggleCmp(false); + this.fullSize = false; + } + else if (width >= 768 && !this.fullSize) { + this.toggleCmp(true); + this.fullSize = true; + } } } }); === modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-visualizer/scripts/app.js' --- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-visualizer/scripts/app.js 2014-11-19 14:56:59 +0000 +++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-visualizer/scripts/app.js 2014-11-20 14:52:46 +0000 @@ -5748,6 +5748,18 @@ region: 'center', bodyStyle: 'padding:1px', autoScroll: true, + fullSize: true, + cmp: [defaultButton], + toggleCmp: function(show) { + for (var i = 0; i < this.cmp.length; i++) { + if (show) { + this.cmp[i].show(); + } + else { + this.cmp[i].hide(); + } + } + }, tbar: { defaults: { height: 26 @@ -5834,6 +5846,11 @@ }); b.menu.show(); + }, + listeners: { + render: function() { + centerRegion.cmp.push(this); + } } }, defaultButton, @@ -5891,12 +5908,22 @@ }); b.menu.show(); + }, + listeners: { + render: function() { + centerRegion.cmp.push(this); + } } }, { xtype: 'tbseparator', height: 18, style: 'border-color:transparent; border-right-color:#d1d1d1; margin-right:4px', + listeners: { + render: function() { + centerRegion.cmp.push(this); + } + } }, { xtype: 'button', @@ -5915,6 +5942,18 @@ if (ns.app.xLayout && ns.app.chart) { ns.app.chart.onViewportResize(); } + + // toolbar + var width = this.getWidth(); + + if (width < 768 && this.fullSize) { + this.toggleCmp(false); + this.fullSize = false; + } + else if (width >= 768 && !this.fullSize) { + this.toggleCmp(true); + this.fullSize = true; + } }, afterrender: function(p) { var liStyle = 'padding:3px 10px; color:#333',