summaryrefslogtreecommitdiff
path: root/js/dojo/dojox/mobile/_ListTouchMixin.js
blob: 2cc6767eb2ffe3e72ea476fa9fc8274018741d71 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
//>>built
define("dojox/mobile/_ListTouchMixin", [
	"dojo/_base/declare",
	"dojo/_base/event",
	"dijit/form/_ListBase"
], function(declare, event, ListBase){

	/*=====
		ListBase = dijit.form._ListBase;
	=====*/
	return declare( "dojox.mobile._ListTouchMixin", ListBase, {
		// summary:
		//		Focus-less menu to handle touch events consistently
		//		Abstract methods that must be defined externally:
		//			onClick: item was chosen (mousedown somewhere on the menu and mouseup somewhere on the menu)
		// tags:
		//		private
	
		postCreate: function(){
			this.inherited(arguments);
			this.connect(this.domNode, "onclick", "_onClick");
		},
	
		_onClick: function(/*Event*/ evt){
			event.stop(evt);
			var target = this._getTarget(evt);
			if(target){
				this._setSelectedAttr(target);
				this.onClick(target);
			}
		}
	});
});