c.on("contextmenu", this.onContextMenu, this);
c.on("keydown", this.onKeyDown, this);
if (Roo.isTouch) {
- c.on("touchend", this.onTouchEnd, this);
+ c.on("touchstart", this.onTouchStart, this);
}
this.relayEvents(c, ["mousedown","mouseup","mouseover","mouseout","keypress"]);
// private
processEvent : function(name, e){
// does this fire select???
- Roo.log('grid:processEvent ' + name);
- if (Roo.isTouch && name == 'click') {
- return;
+ //Roo.log('grid:processEvent ' + name);
+
+ if (name != 'touchstart' ) {
+ this.fireEvent(name, e);
}
- this.fireEvent(name == 'touchend' ? 'click' : name, e);
var t = e.getTarget();
var v = this.view;
var header = v.findHeaderIndex(t);
if(header !== false){
- this.fireEvent("header" + (name == 'touchend' ? 'click' : name), this, header, e);
+ var ename = name == 'touchstart' ? 'click' : name;
+
+ this.fireEvent("header" + ename, this, header, e);
}else{
var row = v.findRowIndex(t);
var cell = v.findCellIndex(t);
- if (name == 'touchend') {
+ if (name == 'touchstart') {
// first touch is always a click.
// hopefull this happens after selection is updated.?
- name = 'click';
+ name = false;
if (typeof(this.selModel.getSelectedCell) != 'undefined') {
var cs = this.selModel.getSelectedCell();
name = 'dblclick';
}
}
-
+ if (!name) {
+ return;
+ }
}
this.processEvent("click", e);
},
// private
- onTouchEnd : function(e){
- this.processEvent("touchend", e);
+ onTouchStart : function(e){
+ this.processEvent("touchstart", e);
},
// private