Guest User

Sencha Touch Scrolling a Non Touch Blackberry

a guest
May 26th, 2011
990
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. app.ux.my_panel = Ext.extend( Ext.Panel, {
  2.     initComponent   :   function() {
  3.  
  4.         app.ux.my_panel.superclass.initComponent.call(this, arguments);
  5.        
  6.         //Setup the scroller for BlackBerry
  7.         var scrollList = this;
  8.         this.on('mousemove', function(evt, div, el) {
  9.             if (scrollList.scroller.offsetBoundary.top === 0) {
  10.                 scrollList.scroller.updateBoundary();
  11.             }
  12.             var maxOffset = scrollList.scroller.offsetBoundary[1] - 400;
  13.             var bottom = scrollList.getHeight() - 15;
  14.             //if (evt.xy[1] > 300 && scrollList.scroller.offset.y >= maxOffset) {
  15.             if (evt.xy[1] > bottom && scrollList.scroller.offset.y >= maxOffset) {
  16.                 var offset = -1 * scrollList.scroller.offset.y + 10;
  17.                 scrollList.scroller.scrollTo({
  18.                     x: 0,
  19.                     y: offset
  20.                 });
  21.             } else if (evt.xy[1] < 60 && scrollList.scroller.offset.y <= 0) {
  22.                 scrollList.scroller.scrollTo({
  23.                     x: 0,
  24.                     y: (-1 * scrollList.scroller.offset.y) - 10
  25.                 });
  26.             }      
  27.         }, null, {element:'el'} );
  28.  
  29.     }
  30. }
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×