@@ -5,8 +5,7 @@ if(!javaxt.dhtml) javaxt.dhtml={};
5
5
//** Table Class
6
6
//******************************************************************************
7
7
/**
8
- * Scrollable table with fixed header. Built-in support for iScroll (just
9
- * include it - no configuration required).
8
+ * Scrollable table with fixed header.
10
9
*
11
10
******************************************************************************/
12
11
@@ -409,15 +408,20 @@ javaxt.dhtml.Table = function(parent, config) {
409
408
if ( config . style . iscroll ) setStyle ( me . iScroll , "iscroll" ) ;
410
409
411
410
412
- me . iScroll . on ( 'scrollStart' , function ( ) {
411
+ //Override the iscroll's translate method so we can catch all
412
+ //scroll movements and prevent scrolling as needed
413
+ var translate = me . iScroll . _translate ;
414
+ me . iScroll . _translate = function ( x , y ) {
415
+ if ( ! scrollEnabled ) return ;
416
+ translate . apply ( me . iScroll , arguments ) ;
417
+ onScroll ( - me . iScroll . y ) ;
418
+ } ;
413
419
414
- if ( ! scrollEnabled ) {
415
- //Stop iscroll! Not sure how to do this but throwing an
416
- //error seems to work...
417
- throw new Error ( 'IScroll disabled' ) ;
418
- return ;
419
- }
420
+ me . iScroll . on ( 'beforeScrollStart' , function ( ) {
421
+ onScroll ( - me . iScroll . y ) ;
422
+ } ) ;
420
423
424
+ me . iScroll . on ( 'scrollStart' , function ( ) {
421
425
onScroll ( - me . iScroll . y ) ;
422
426
} ) ;
423
427
0 commit comments