|
Lines 32-37
Link Here
|
| 32 |
widget.setStyleProperty( "fontSize", "0" ); |
32 |
widget.setStyleProperty( "fontSize", "0" ); |
| 33 |
widget.setStyleProperty( "lineHeight", "0" ); |
33 |
widget.setStyleProperty( "lineHeight", "0" ); |
| 34 |
} |
34 |
} |
| 35 |
} |
35 |
}, |
| 36 |
} |
36 |
|
|
|
37 |
//----------------- disable scrolling ------------------- |
| 38 |
|
| 39 |
scrollBack : function( widget ) { |
| 40 |
var el = widget._getTargetNode(); |
| 41 |
if( el ) { |
| 42 |
this._scrollBack( el ); |
| 43 |
} |
| 44 |
}, |
| 45 |
|
| 46 |
disableScrolling : function( widget ) { |
| 47 |
var el = widget._getTargetNode(); |
| 48 |
if( el ) { |
| 49 |
this._attachOnscrollEvent( el ); |
| 50 |
} else { |
| 51 |
widget.addEventListener( "appear", this._onElementCreate, this ); |
| 52 |
} |
| 53 |
}, |
| 54 |
|
| 55 |
enableScrolling : function( widget ) { |
| 56 |
var el = widget._getTargetNode(); |
| 57 |
if( el ) { |
| 58 |
this._removeOnscrollEvent( el ); |
| 59 |
} else { |
| 60 |
widget.removeEventListener( "appear", this._onElementCreate, this ); |
| 61 |
} |
| 62 |
}, |
| 63 |
|
| 64 |
_onElementCreate : function( ev ){ |
| 65 |
var widget = ev.getTarget(); |
| 66 |
widget.removeEventListener( "appear", this._onElementCreate, this ); |
| 67 |
this._attachOnscrollEvent( widget._getTargetNode() ); |
| 68 |
}, |
| 69 |
|
| 70 |
_attachOnscrollEvent : function( el ) { |
| 71 |
if ( qx.core.Variant.isSet( "qx.client", "mshtml" ) ) { |
| 72 |
el.attachEvent( "onscroll", this._onscroll ); |
| 73 |
} else { |
| 74 |
el.addEventListener( "scroll", this._onscroll, false ); |
| 75 |
} |
| 76 |
}, |
| 77 |
|
| 78 |
_removeOnscrollEvent : function( el ) { |
| 79 |
if ( qx.core.Variant.isSet( "qx.client", "mshtml" ) ) { |
| 80 |
el.detachEvent( "onscroll", this._onscroll ); |
| 81 |
} else { |
| 82 |
el.removeEventListener( "scroll", this._onscroll, false ); |
| 83 |
} |
| 84 |
}, |
| 85 |
|
| 86 |
_onscroll : function( ev ) { |
| 87 |
var el = ev.target || ev.srcElement; |
| 88 |
org.eclipse.swt.WidgetUtil._scrollBack( el ); |
| 89 |
}, |
| 90 |
|
| 91 |
_scrollBack : function( el ) { |
| 92 |
if( el.scrollLeft != 0 || el.scrollTop != 0 ) { |
| 93 |
el.scrollLeft = 0; |
| 94 |
el.scrollTop = 0; |
| 95 |
} |
| 96 |
} |
| 97 |
} |
| 37 |
}); |
98 |
}); |