dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #33288
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 16979: PT DV GIS ER EV treepanel scrollbar bug workaround.
Merge authors:
Jan Henrik Øverland (janhenrik-overland)
------------------------------------------------------------
revno: 16979 [merge]
committer: Jan Henrik Overland <janhenrik.overland@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2014-10-07 12:56:52 +0200
message:
PT DV GIS ER EV treepanel scrollbar bug workaround.
modified:
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-visualizer/scripts/app.js
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-pivot/scripts/app.js
dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-visualizer/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-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-10-07 10:08:29 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-reports/scripts/app.js 2014-10-07 10:55:39 +0000
@@ -30,6 +30,40 @@
}
});
+ Ext.override(Ext.grid.Scroller, {
+ afterRender: function() {
+ var me = this;
+ me.callParent();
+ me.mon(me.scrollEl, 'scroll', me.onElScroll, me);
+ Ext.cache[me.el.id].skipGarbageCollection = true;
+ // add another scroll event listener to check, if main listeners is active
+ Ext.EventManager.addListener(me.scrollEl, 'scroll', me.onElScrollCheck, me);
+ // ensure this listener doesn't get removed
+ Ext.cache[me.scrollEl.id].skipGarbageCollection = true;
+ },
+
+ // flag to check, if main listeners is active
+ wasScrolled: false,
+
+ // synchronize the scroller with the bound gridviews
+ onElScroll: function(event, target) {
+ this.wasScrolled = true; // change flag -> show that listener is alive
+ this.fireEvent('bodyscroll', event, target);
+ },
+
+ // executes just after main scroll event listener and check flag state
+ onElScrollCheck: function(event, target, options) {
+ var me = this;
+
+ if (!me.wasScrolled) {
+ // Achtung! Event listener was disappeared, so we'll add it again
+ me.mon(me.scrollEl, 'scroll', me.onElScroll, me);
+ }
+ me.wasScrolled = false; // change flag to initial value
+ }
+
+ });
+
// right click handler
document.body.oncontextmenu = function() {
return false;
=== 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-10-03 11:08:36 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-visualizer/scripts/app.js 2014-10-07 10:55:39 +0000
@@ -29,6 +29,40 @@
}
});
+ Ext.override(Ext.grid.Scroller, {
+ afterRender: function() {
+ var me = this;
+ me.callParent();
+ me.mon(me.scrollEl, 'scroll', me.onElScroll, me);
+ Ext.cache[me.el.id].skipGarbageCollection = true;
+ // add another scroll event listener to check, if main listeners is active
+ Ext.EventManager.addListener(me.scrollEl, 'scroll', me.onElScrollCheck, me);
+ // ensure this listener doesn't get removed
+ Ext.cache[me.scrollEl.id].skipGarbageCollection = true;
+ },
+
+ // flag to check, if main listeners is active
+ wasScrolled: false,
+
+ // synchronize the scroller with the bound gridviews
+ onElScroll: function(event, target) {
+ this.wasScrolled = true; // change flag -> show that listener is alive
+ this.fireEvent('bodyscroll', event, target);
+ },
+
+ // executes just after main scroll event listener and check flag state
+ onElScrollCheck: function(event, target, options) {
+ var me = this;
+
+ if (!me.wasScrolled) {
+ // Achtung! Event listener was disappeared, so we'll add it again
+ me.mon(me.scrollEl, 'scroll', me.onElScroll, me);
+ }
+ me.wasScrolled = false; // change flag to initial value
+ }
+
+ });
+
// right click handler
document.body.oncontextmenu = function() {
return false;
=== 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-10-06 20:42:13 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-mapping/scripts/app.js 2014-10-07 10:55:39 +0000
@@ -15,6 +15,40 @@
}
});
+ Ext.override(Ext.grid.Scroller, {
+ afterRender: function() {
+ var me = this;
+ me.callParent();
+ me.mon(me.scrollEl, 'scroll', me.onElScroll, me);
+ Ext.cache[me.el.id].skipGarbageCollection = true;
+ // add another scroll event listener to check, if main listeners is active
+ Ext.EventManager.addListener(me.scrollEl, 'scroll', me.onElScrollCheck, me);
+ // ensure this listener doesn't get removed
+ Ext.cache[me.scrollEl.id].skipGarbageCollection = true;
+ },
+
+ // flag to check, if main listeners is active
+ wasScrolled: false,
+
+ // synchronize the scroller with the bound gridviews
+ onElScroll: function(event, target) {
+ this.wasScrolled = true; // change flag -> show that listener is alive
+ this.fireEvent('bodyscroll', event, target);
+ },
+
+ // executes just after main scroll event listener and check flag state
+ onElScrollCheck: function(event, target, options) {
+ var me = this;
+
+ if (!me.wasScrolled) {
+ // Achtung! Event listener was disappeared, so we'll add it again
+ me.mon(me.scrollEl, 'scroll', me.onElScroll, me);
+ }
+ me.wasScrolled = false; // change flag to initial value
+ }
+
+ });
+
// right click handler
document.body.oncontextmenu = function() {
return false;
=== 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-10-07 10:08:29 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-pivot/scripts/app.js 2014-10-07 10:55:39 +0000
@@ -28,6 +28,40 @@
}
});
+ Ext.override(Ext.grid.Scroller, {
+ afterRender: function() {
+ var me = this;
+ me.callParent();
+ me.mon(me.scrollEl, 'scroll', me.onElScroll, me);
+ Ext.cache[me.el.id].skipGarbageCollection = true;
+ // add another scroll event listener to check, if main listeners is active
+ Ext.EventManager.addListener(me.scrollEl, 'scroll', me.onElScrollCheck, me);
+ // ensure this listener doesn't get removed
+ Ext.cache[me.scrollEl.id].skipGarbageCollection = true;
+ },
+
+ // flag to check, if main listeners is active
+ wasScrolled: false,
+
+ // synchronize the scroller with the bound gridviews
+ onElScroll: function(event, target) {
+ this.wasScrolled = true; // change flag -> show that listener is alive
+ this.fireEvent('bodyscroll', event, target);
+ },
+
+ // executes just after main scroll event listener and check flag state
+ onElScrollCheck: function(event, target, options) {
+ var me = this;
+
+ if (!me.wasScrolled) {
+ // Achtung! Event listener was disappeared, so we'll add it again
+ me.mon(me.scrollEl, 'scroll', me.onElScroll, me);
+ }
+ me.wasScrolled = false; // change flag to initial value
+ }
+
+ });
+
// right click handler
document.body.oncontextmenu = function() {
return false;
=== 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-10-06 12:01:56 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-visualizer/scripts/app.js 2014-10-07 10:55:39 +0000
@@ -28,6 +28,40 @@
}
});
+ Ext.override(Ext.grid.Scroller, {
+ afterRender: function() {
+ var me = this;
+ me.callParent();
+ me.mon(me.scrollEl, 'scroll', me.onElScroll, me);
+ Ext.cache[me.el.id].skipGarbageCollection = true;
+ // add another scroll event listener to check, if main listeners is active
+ Ext.EventManager.addListener(me.scrollEl, 'scroll', me.onElScrollCheck, me);
+ // ensure this listener doesn't get removed
+ Ext.cache[me.scrollEl.id].skipGarbageCollection = true;
+ },
+
+ // flag to check, if main listeners is active
+ wasScrolled: false,
+
+ // synchronize the scroller with the bound gridviews
+ onElScroll: function(event, target) {
+ this.wasScrolled = true; // change flag -> show that listener is alive
+ this.fireEvent('bodyscroll', event, target);
+ },
+
+ // executes just after main scroll event listener and check flag state
+ onElScrollCheck: function(event, target, options) {
+ var me = this;
+
+ if (!me.wasScrolled) {
+ // Achtung! Event listener was disappeared, so we'll add it again
+ me.mon(me.scrollEl, 'scroll', me.onElScroll, me);
+ }
+ me.wasScrolled = false; // change flag to initial value
+ }
+
+ });
+
// right click handler
document.body.oncontextmenu = function() {
return false;