_ListTouchMixin.js 824 B

1234567891011121314151617181920212223242526272829303132
  1. define("dojox/mobile/_ListTouchMixin", [
  2. "dojo/_base/declare",
  3. "dojo/_base/event",
  4. "dijit/form/_ListBase"
  5. ], function(declare, event, ListBase){
  6. /*=====
  7. ListBase = dijit.form._ListBase;
  8. =====*/
  9. return declare( "dojox.mobile._ListTouchMixin", ListBase, {
  10. // summary:
  11. // Focus-less menu to handle touch events consistently
  12. // Abstract methods that must be defined externally:
  13. // onClick: item was chosen (mousedown somewhere on the menu and mouseup somewhere on the menu)
  14. // tags:
  15. // private
  16. postCreate: function(){
  17. this.inherited(arguments);
  18. this.connect(this.domNode, "onclick", "_onClick");
  19. },
  20. _onClick: function(/*Event*/ evt){
  21. event.stop(evt);
  22. var target = this._getTarget(evt);
  23. if(target){
  24. this._setSelectedAttr(target);
  25. this.onClick(target);
  26. }
  27. }
  28. });
  29. });