Permalink
Browse files

Use only-touch in other appropriate has tests

  • Loading branch information...
kriszyp committed Feb 14, 2014
1 parent 33d59db commit b642324ff195fb591d93cd162eee49edf7716851
Showing with 7 additions and 7 deletions.
  1. +3 −3 ColumnSet.js
  2. +2 −2 Selection.js
  3. +2 −2 extensions/DnD.js
View
@@ -1,4 +1,4 @@
-define(["dojo/_base/kernel", "dojo/_base/declare", "dojo/_base/lang", "dojo/_base/Deferred", "dojo/on", "dojo/aspect", "dojo/query", "dojo/has", "./util/misc", "put-selector/put", "xstyle/has-class", "./Grid", "dojo/_base/sniff", "xstyle/css!./css/columnset.css"],
+define(["dojo/_base/kernel", "dojo/_base/declare", "dojo/_base/lang", "dojo/_base/Deferred", "dojo/on", "dojo/aspect", "dojo/query", "./has", "./util/misc", "put-selector/put", "xstyle/has-class", "./Grid", "dojo/_base/sniff", "xstyle/css!./css/columnset.css"],
function(kernel, declare, lang, Deferred, listen, aspect, query, has, miscUtil, put, hasClass, Grid){
has.add("event-mousewheel", function(global, document, element){
return typeof element.onmousewheel !== "undefined";
@@ -66,7 +66,7 @@ function(kernel, declare, lang, Deferred, listen, aspect, query, has, miscUtil,
}
var horizMouseWheel;
- if(!has("touch")){
+ if(!has("only-touch")){
horizMouseWheel = has("event-mousewheel") || has("event-wheel") ? function(grid){
return function(target, listener){
return listen(target, has("event-wheel") ? "wheel" : "mousewheel", function(event){
@@ -114,7 +114,7 @@ function(kernel, declare, lang, Deferred, listen, aspect, query, has, miscUtil,
postCreate: function(){
this.inherited(arguments);
- if(!has("touch")){
+ if(!has("only-touch")){
this.on(horizMouseWheel(this), function(grid, colsetNode, amount){
var id = colsetNode.getAttribute(colsetidAttr),
scroller = grid._columnSetScrollers[id],
View
@@ -1,4 +1,4 @@
-define(["dojo/_base/kernel", "dojo/_base/declare", "dojo/_base/Deferred", "dojo/on", "dojo/has", "dojo/aspect", "./List", "dojo/has!touch?./util/touch", "put-selector/put", "dojo/query", "dojo/_base/sniff"],
+define(["dojo/_base/kernel", "dojo/_base/declare", "dojo/_base/Deferred", "dojo/on", "dojo/has", "dojo/aspect", "./List", "./has!only-touch?./util/touch", "put-selector/put", "dojo/query", "dojo/_base/sniff"],
function(kernel, declare, Deferred, on, has, aspect, List, touchUtil, put){
has.add("pointer", function(global, doc, element){
@@ -299,7 +299,7 @@ return declare(null, {
select: []
};
- if(has("touch") && !has("pointer")){
+ if(has("only-touch") && !has("pointer")){
// listen for touch taps if available
on(this.contentNode, touchUtil.selector(selector, touchUtil.tap), function(evt){
grid._handleSelect(evt, this);
View
@@ -159,7 +159,7 @@ define([
onMouseDown: function(evt){
// Cancel the drag operation on presence of more than one contact point.
// (This check will evaluate to false under non-touch circumstances.)
- if(has("touch") && this.isDragging &&
+ if(has("only-touch") && this.isDragging &&
touchUtil.countCurrentTouches(evt, this.grid.touchNode) > 1){
topic.publish("/dnd/cancel");
DnDManager.manager().stopDrag();
@@ -170,7 +170,7 @@ define([
onMouseMove: function(evt){
// If we're handling touchmove, only respond to single-contact events.
- if(!has("touch") || touchUtil.countCurrentTouches(evt, this.grid.touchNode) === 1){
+ if(!has("only-touch") || touchUtil.countCurrentTouches(evt, this.grid.touchNode) === 1){
this.inherited(arguments);
}
},

0 comments on commit b642324

Please sign in to comment.