_Widget.js 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. /*
  2. Copyright (c) 2004-2012, The Dojo Foundation All Rights Reserved.
  3. Available via Academic Free License >= 2.1 OR the modified BSD license.
  4. see: http://dojotoolkit.org/license for details
  5. */
  6. if(!dojo._hasResource["dojox.mobile.app._Widget"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
  7. dojo._hasResource["dojox.mobile.app._Widget"] = true;
  8. dojo.provide("dojox.mobile.app._Widget");
  9. dojo.experimental("dojox.mobile.app._Widget");
  10. dojo.require("dijit._WidgetBase");
  11. dojo.declare("dojox.mobile.app._Widget", dijit._WidgetBase, {
  12. // summary:
  13. // The base mobile app widget.
  14. getScroll: function(){
  15. // summary:
  16. // Returns the scroll position.
  17. return {
  18. x: dojo.global.scrollX,
  19. y: dojo.global.scrollY
  20. };
  21. },
  22. connect: function(target, event, fn){
  23. if(event.toLowerCase() == "dblclick"
  24. || event.toLowerCase() == "ondblclick"){
  25. if(dojo.global["Mojo"]){
  26. // Handle webOS tap event
  27. return this.connect(target, Mojo.Event.tap, fn);
  28. }
  29. }
  30. return this.inherited(arguments);
  31. }
  32. });
  33. }